turbo icon indicating copy to clipboard operation
turbo copied to clipboard

New TUI: Scrolling behavior can be improved

Open anthonyshew opened this issue 1 year ago • 1 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

N/A

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Other

Which canary version will you have in your reproduction?

2.0.6-canary.0

Describe the Bug

Lifting out questions about scrolling from https://github.com/vercel/turbo/issues/8372 so we can have separate GitHub Issues for separate issues.

Expected Behavior

See comments both on the original issue and below for expected behavior from the community.

To Reproduce

Scrolling in the new TUI.

Additional context

No response

anthonyshew avatar Jul 01 '24 16:07 anthonyshew

Any update on this?

IshfaqAhmedProg avatar Sep 03 '24 14:09 IshfaqAhmedProg

I'm having problems with this too. Our application logs a lot of debug data when executing tasks, and the new TUI seems to limit scrollback, so I can't scroll up to see the startup parameters logged at the beginning of the task execution. I do not have this problem if disabling the new TUI. I find it very strange that Turbo would override the scrollback I've already configured in my terminal.

aronstrandberg avatar Jan 27 '25 13:01 aronstrandberg

@aronstrandberg Doesn't solve your problem but, for context, the TUI renders in a vterm so doesn't automatically inherit your configurations. We hardcoded the buffer length since we couldn't find any way to do it in the xterm spec.

This class of problem isn't unique to Turborepo's TUI, for what it's worth. Anything rendering to an alt screen or manipulating your terminal can/will suffer from the same problems (nvim, tmux, etc.), and is the reason that we've struggled with figuring out a solution we like/users will like for the other scrolling behavior questions. Terminals are ooooold technology, and we're stretching them past their limits. 😄

anthonyshew avatar Jan 27 '25 19:01 anthonyshew

But I'm able to use pgUp pgDown fine in those mentioned vt, how do you scroll to bottom w turbo tui?

darr1s avatar Jan 30 '25 16:01 darr1s

how do you scroll to bottom w turbo tui?

@darr1s Are you meaning you're looking for a hotkey to do this with? We do have u and d now to scroll one line up and down, but we could also do a keybind for paging or jumping to top/bottom.

anthonyshew avatar Mar 15 '25 02:03 anthonyshew

Hey @anthonyshew, the scrolling seems like not respect the scroll steps of native term/os (tested on both Windows/Mac). I noticed there are scrolling up/down button however they only scroll by 1 step.

My use case is building on the t3-stack (https://github.com/t3-oss/create-t3-turbo) and it is very difficult to scroll up and down to see terminal logs/errors. Furthermore it seems like it is not possible to have hybrid TUI/stream UI when there is a particular package requires TUI interactivity.

I wonder is it possible for turbo to replace its TUI with some existing open source TUI framework, which should provides good defaults for hotkey and UI rendering utilities. ie. https://github.com/gin66/tui-logger

Appreciate if you could give some pointer.

darr1s avatar Mar 17 '25 09:03 darr1s

FWIW, 1,024 lines feels like a very low limit given the resources available to modern systems. If the average line of text is something like 70-100 bytes, that comes out to approximately 100KB. This ought to be configurable at the very least.

Aside from that, Page Up/Down support would be very much appreciated, as would some way of jumping to the start and end of the output—I think Ctrl+Home/End are fairly standard for that?

spinda avatar Mar 24 '25 21:03 spinda

@anthonyshew I would kill for a hotkey to jump to bottom.

devontivona avatar Mar 25 '25 23:03 devontivona

Scrolling to the bottom would be awesome. @anthonyshew, based on your prior considerations of the status of terminals, do you think it is feasible?

fox1t avatar Mar 26 '25 10:03 fox1t

@darr1s The package you've linked is deprecated in favor of Ratatui, which we use.

anthonyshew avatar Mar 29 '25 03:03 anthonyshew

@spinda @darr1s @aronstrandberg, see https://github.com/vercel/turborepo/pull/10247 for scrollback length.

anthonyshew avatar Mar 29 '25 04:03 anthonyshew

@darr1s @danielfehergoto @devontivona @fox1t @ThallesP, see https://github.com/vercel/turborepo/pull/10248 for added keybinds.

anthonyshew avatar Mar 29 '25 04:03 anthonyshew

Folks, with #10247 and #10248 now merged, I'm going to close out this issue. It appears most of what is in this Issue and #8372 that preceded it has been addressed. If there's something you believe is still not implemented well enough that it deserves to be called a bug, please open a fresh Issue. You can also request new features with a Discussion.

Thanks for the patience and giving us your feedback. 🙏

anthonyshew avatar Apr 07 '25 19:04 anthonyshew