Skip to content
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

Support scrolling the terminal #404

Open
joshka opened this issue Nov 8, 2023 · 2 comments
Open

Support scrolling the terminal #404

joshka opened this issue Nov 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@joshka
Copy link
Contributor

joshka commented Nov 8, 2023

Is your feature request related to a problem? Please describe.
Let's say we have a command that outputs a bunch of data to the terminal, some of which causes the terminal to scroll. I'd like some way to cause the terminal to scroll up to see the previous data in the gif.

My specific use case for this is in Ratatui (a rust TUI lib) testing that we can insert information before the current viewport (writable part of the screen for an app), and that this is in the correct position after the draw.

Describe the solution you'd like
Two commands ScrollUp N and ScrollDown N that scroll by a number of rows

Describe alternatives you've considered
I'm not sure if there is a generic way to do this with keyboard shortcuts (most apps will not pass PageUp/PageDown to the terminal in a way that's useful)

Additional context
Looking for less manual ways to test ratatui-org/ratatui#596

@joshka joshka added the enhancement New feature or request label Nov 8, 2023
@maaslalani
Copy link
Member

Yes, we should certainly have this as well as other mouse controls. One thing I would change about the API is to introduce negative numbers as a way to scroll up lines (possibly):

Scroll 5 # scroll down 5 lines
Scroll -5 # scroll up 5 lines

@joshka
Copy link
Contributor Author

joshka commented Nov 28, 2023

Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants