nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
513 stars 139 forks source link

prompt overwrites text line if no newline is found #398

Open fdncred opened 2 years ago

fdncred commented 2 years ago

Platform Windows 11 Terminal software Windows Terminal

Describe the problem you are observing. When the steps are followed below, you see the text initially appear on the screen and then the prompt overwrites the last line.

Steps to reproduce (from within nushell)

  1. touch a
  2. notepad a
  3. type some text, hit enter, type some more text and DO NOT hit enter (this is key, the last line must not have a crlf)
  4. cat a or type a shows both lines of text, and then when the prompt is drawn, it overwrites the last line
sholderbach commented 2 years ago

Could not reproduce on linux with either cat testfile or nu's open --raw testfile (File had to be stripped of the last new line by perl -pi -e 'chomp if eof' testfile.txt). The prompt initialization assumes if the cursor is in the first column it can start there else it introduces a new line. Maybe the windows file dumping has different behavior there?

fdncred commented 2 years ago

Maybe it's only a Windows thing?

fdncred commented 2 years ago

@elferherrera, you use Windows. Can you reproduce this error?

elferherrera commented 2 years ago

I followed the instructions but it seems to work fine image

fdncred commented 2 years ago

I'm pretty sure it's only on the last/bottom line of the terminal. I guess I forgot to say that originally.

DejayRezme commented 2 years ago

I could reproduce the bug with open --raw testfile on windows terminal as well as wezterm and alacrtitty. I could not reproduce with 'type' command.

The other mentioned bug "reloading config hotkey deletes top line instead of adding it to scrollback" #5305 is reproducible on windows with windows terminal, wezterm and alacrtitty.

This was with 0.61.0

mati865 commented 1 month ago

From my experience with Nushell such issues might be dependent on terminal size or whether it was resized.