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

Reducing the height of a WSL less pager doesn't redraw correctly #112

Closed
rprichard opened this issue Apr 23, 2017 · 0 comments
Closed

Reducing the height of a WSL less pager doesn't redraw correctly #112

rprichard opened this issue Apr 23, 2017 · 0 comments
Labels

Comments

@rprichard
Copy link
Owner

I ran less /etc/protocols in WSL, then reduced the height of the window by a few lines. winpty didn't handle the resizing correctly:

example

Presumably it's doing something like this:

  1. mintty shifts the contents of the terminal up the few lines, as well as the cursor.
  2. The console also shifts both content+cursor up, or maybe it doesn't. In any case, less redraws the screen rapidly.
  3. winpty scans for changes and sees that only the last line of the window has changed -- the one that now has the colon prompt.
  4. The winpty Scraper object sends the prompt line to the Terminal object and reports that it's a few lines upwards from where the cursor previously was.
  5. The Terminal object moves the terminal cursor up a few lines and outputs the cursor.

WSL less uses the "alternate screen" VT mode, which sets the console's buffer height to its window height. winpty detects this situation and enters "direct mode". Direct mode makes no attempt to keep the scrollback valid, so this is easy to fix by invalidating the scraper's cell buffer on resize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant