reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Prompt jumps to end of screen

Open ClementNerma opened this issue 1 year ago • 4 comments

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:

image

After pressing a key:

image

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.

ClementNerma avatar Nov 12 '23 09:11 ClementNerma

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

101313 avatar Dec 15 '23 00:12 101313

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.

sholderbach avatar Dec 15 '23 12:12 sholderbach

This happens for me toowhen my terminal is taller than 24 characters.

Fedora 38 on Gnome 44.10 using GNOME Terminal (NOT GNOME console)

tryoxiss avatar May 16 '24 17:05 tryoxiss

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.

sholderbach avatar May 16 '24 20:05 sholderbach