-
Notifications
You must be signed in to change notification settings - Fork 164
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
fix: prompt position on resize #578
Conversation
I haven't checked the u16 overflow and the UX_TESTING yet because it's time to go to bed here so I will do the checks and tests tomorrow. |
Thanks so much for giving this a shot, there have been many futile attempt, would be great if you can resolve that! For UX testing, interesting edge cases are: Resize related
What happens below the prompt
Possible artifacts due to assumption reedline made from its development with a relatively consistent prompt.
Cursor position behavior is some what dependent on the scrollback of the terminal emulator
|
fix: resume the early return to exclude a case where the terminal got smaller but the prompt is still visible
After a bunch of random tests, I found out there is a trade off between not overwriting any previous output and producing fewer incomplete duplicate prompts on window resizing. I prefer the former since:
So I decided to just set the |
Basically every time the window changes in size, it's expected to see incomplete duplicate prompt fragments. The main focus of the checklist expects no outputs being overwritten by the prompt. Thanks for the checklist so that I found a bug on horizontal resizing just now (and fixed)! ChecklistResize related
What happens below the prompt
Possible artifacts due to assumption reedline made from its development with a relatively consistent prompt.
Cursor position behavior is some what dependent on the scrollback of the terminal emulator
|
I will have to put aside a bit of time for playing around but your suggestions sound good and the items on the list are promising!
Fully agree on your preferences here! Keeping the potentially valuable output to me would be higher priority than dealing fully gracefully with the rarer resizing. (I know that resizing can also be quite frequent if you change a tiling layout in desktop or terminal multiplexer...) Regarding your question on the test suggestions:
I was thinking about pressing enter often enough that the prompt is at the last line of the screen to fit the buffer or multiline buffer there. The screen shouldn't start flowing over with content because text wrapping is not correclty accounted for in the prompt positioning. |
I played around with the demo a bit, and it looked pretty good. I think we could land and dogfood in nightly nushell to see how it works in practice. Thanks for the PR! |
Fix: nushell/nushell#9015
Previously, when the terminal window shrinks its height, the prompt eats the previous line.
Now, the prompt will not overwrite the previous line.