New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): render ui to alternative screen #8084
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
🟢 CI successful 🟢Thanks |
Would this make it easier to allow selection of log entries? |
Not sure I follow. As in easier to copy/paste from logs from tasks after |
Easier to select from the |
9edecbf
to
544a1d0
Compare
Ah, no. That broke due to us supporting mouse scroll for scrolling through task outputs. I might need to disable that feature and only allow keybinds. The alternative is to manually implement terminal selection and click support which isn't something I want to tackle at this moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// visible_rows can never return enough rows to overflow here | ||
let i = i.try_into().unwrap(); | ||
let mut contents = vec![]; | ||
// We don't need final cursor position as long as CRLF is used and not just LF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment. Where would the CRLF or LF be coming from? is it user input? (in which case, is LF not possible on Windows?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a terminal is in raw mode a LF only will move the cursor down a row, but not return it to the home (zero) column. This leads the string foo\nbar
being printed in a raw terminal looking like
foo
bar
where foo\r\nbar
will be printed as expected
foo
bar
The comment is meant to explain why we aren't storing/restoring the final cursor position as we expect the caller to print these lines with a trailing \r\n
.
### Description Change the layout of the UI display better on smaller terminals. - Removal of task timeline in favor of spinners and icons for finished tasks - Move task list to sidebar This PR also removes persisting writer codepaths as those are no-ops now that we aren't using an inline view. ### Testing Instructions https://github.com/vercel/turbo/assets/4131117/10fc9f99-8772-4e03-bc83-6ae9e267f0cd Closes TURBO-3023
Description
Changes our UI to render in the alternative screen (think
vim
orless
)This provides a few benefits:
insert_before
for persisting task logs. This function panics if there isn't an available row to render to (Turborepo panics when Ctrl-Cing #8072) or rendering terminal logs that have an area that exceedsu16::MAX
(Turborepo canary panics with 'index out of bounds: the len is 65535 but the index is 65535' #7843). Instead our log persisting story is a "simple"stdout.write_all()
.We write the logs in a row-wise fasion as
vt100
attempts to optimize performance by using cursor moves to avoid necessary writes. This creates problems when printing multiple terminal screens as the cursor move coordinates will be incorrect.Testing Instructions
Screen.Recording.2024-05-03.at.9.52.45.AM.mov
Closes TURBO-2979