AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 350 forks source link

Last line in prompt becomes invisible when a character is typed and then deleted on a previous line #437

Closed pokir closed 1 year ago

pokir commented 1 year ago

What operating system and terminal are you using?

MacOS 12.4; alacritty (but bug is reproducible in any terminal)

An example that showcases the bug.

This is a bug found in GitHub's CLI that uses the survey library. See this issue in GitHub's CLI.

  1. Open new terminal window in a git repo
  2. Press enter many times until the terminal scrolls down
  3. Run gh issue create
  4. Type text in the Title prompt until it wraps to a new line at least once
  5. Move the cursor to a previous line before the line wrap
  6. Type a character and delete it
Capture d’écran 2022-07-31 à 17 03 11 Capture d’écran 2022-07-31 à 17 03 24 Capture d’écran 2022-07-31 à 17 03 39

What did you expect to see?

Text on the last line

What did you see instead?

No text on the last line

pokir commented 1 year ago

This can also be done with go run examples/simple.go (in the repo) instead of using gh.

AlecAivazis commented 1 year ago

Mind checking if this is still a problem now that #445 has been merged? I'm unable to reproduce it on the lastest master

AlecAivazis commented 1 year ago

I'm going to close this since its gone a bit stale and I can't reproduce it.