terminal: Command History on wrong line

Environment

Windows build number: 10.0.19041.329
Windows Terminal version (if applicable): 1.0.1401.0

Any other software? no

Steps to reproduce

Cannot reproduce on demand, but I know it occurred after dragging the window to a new size (number of rows and columns.)

Expected behavior

I was in a Command Prompt, using the Up Arrow to recall my command history. I expected the recalled commands to appear on the current command line.

Actual behavior

The FIRST command recalled appeared on the current command line, subsequently recalled commands (I pressed Up Arrow more than once) appeared one row above but indented as if after a prompt (though the line above was previously blank.)

FWIW, this is not the first issue I’ve seen after resizing the window, but almost all of them go away after another resize and do not return if I try to return to the previous size and test for them. So the triggers are difficult to define, sorry. Hopefully this will at least warrant some comments near where this is handled, just in case something is noticed in the code. 😃

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 21 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Hooplah, a consistent repro from #9897

Steps to reproduce:

  1. Open Terminal (PowerShell)
  2. Push Enter enough times to get to the bottom of the window
  3. Enter line long enough so it will get broken when window is resized horizontally
  4. Move cursor backwards and enter a different character to mark your position
  5. Resize the window horizontally.
  6. When the line gets broken and text scrolls up observe that the cursor is not where it should be

Old console doesn’t have this issue.

cmd.exe in Terminal app has a similar issue

I’ll add that I remove-module psreadline’s first

9897-did-repro-000

Nope. We’ll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? image That way you’ll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️