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

multiline issues if input spans terminal height #611

Open
strtok opened this issue Mar 23, 2022 · 1 comment · May be fixed by #622
Open

multiline issues if input spans terminal height #611

strtok opened this issue Mar 23, 2022 · 1 comment · May be fixed by #622

Comments

@strtok
Copy link

strtok commented Mar 23, 2022

I'm working on porting rustyline to typescript+xtermjs and I noticed in testing multiline handlnig that rustyline exhibits a lot of issues if the input happens to cause the terminal to scroll the top of the prompt away (i.e. the input ends up being > row height of the terminal).

There's a few ways to see symptoms of this:

  1. Start a multiline prompt and add enough lines so that the prompt scrolls above the terminal window. Scroll up with the terminal and you will see that multiple prompts have been rendered, likely as an effect of how the refresh() code deals with refreshing a terminal.
  2. Input enough lines so that the terminal prompt scrolls above the terminal window, and then arrow up. It is not possible to arrow up to the text that scrolled away.

Is this a limitation of how the virtual terminal handles cursor movement? i.e. not allowing the cursor to manipulate text that has scrolled? If so, I imagine this is not easy to fix without implementing state that understands what text should be displayed on the active terminal window and refreshing as the cursor scrolls the terminal.

@gwenn
Copy link
Collaborator

gwenn commented Mar 23, 2022

This is a limitation of rustyline (last time I checked, only python prompt toolkit handles scrolling).
See #378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants