reedline
reedline copied to clipboard
Prompt jumps to end of screen
Environment: Windows 11 -> Windows Terminal
When inputting anything in the prompt on Windows Terminal, the prompt jumps to the last line immediatly. It also happens when just using a directional arrow key or backspace (so even when no character is added / removed and no cursor move is performed).
This happens even by just making a simple Rust program made of read_line(&DefaultPrompt::default()
without anything else.
Initial state:
After pressing a key:
EDIT: This does not happen if a line was already printed in the terminal. So launching PowerShell for instance then reading a line won't produce this jump.
Can confirm this as well on a linux environment under wayland compositor and foot terminal emulator. Hacking it with an empty print at the end of my config seemingly does the trick for now
Interesting observation that a print in the config can preempt this. Maybe this affects the reported cursor position or causes a flush. A lead worth investigating.
This happens for me toowhen my terminal is taller than 24 characters.
Fedora 38 on Gnome 44.10 using GNOME Terminal (NOT GNOME console)
24 is a good hint! Thanks for that. If we don't get a size reported from the terminal on startup we initialize to the prototypical 80x24 size to avoid overflows with 0x0 size.