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

Prompt jumps to end of screen #665

Open
ClementNerma opened this issue Nov 12, 2023 · 4 comments
Open

Prompt jumps to end of screen #665

ClementNerma opened this issue Nov 12, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ClementNerma
Copy link
Contributor

ClementNerma commented Nov 12, 2023

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.

@101313
Copy link

101313 commented Dec 15, 2023

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

@sholderbach
Copy link
Member

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.

@tryoxiss
Copy link

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

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

@sholderbach
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants