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

various resizing and WSL bugs to investigate #111

Open
rprichard opened this issue Apr 23, 2017 · 2 comments
Open

various resizing and WSL bugs to investigate #111

rprichard opened this issue Apr 23, 2017 · 2 comments

Comments

@rprichard
Copy link
Owner

I'm getting confused by all the resizing/WSL bugs I'm seeing. I'm keeping my notes here for now.

Bugs to file:

  1. Report the Cygwin fillin bug (Terminal resize not always propagated to program running under winpty #110 (comment)) and try patching it; it'll be trivial to fix. The hardest part will be figuring out how to compile and use cygwin1.dll. Just running less /etc/protocols in a console, without winpty, seems to demonstrate the bug. Reduce the console height, and try to page up and down. The winpty WINDOW_BUFFER_SIZE_EVENT workaround seems to also fix this bug.

Research:

  1. Cygwin never enters winpty's "direct mode", but WSL less/vim/nano does (i.e. "alternate screen" mode). There seems to be a bug in direct mode where the console and terminal get out-of-sync. I need to revisit the logic here; maybe I got it wrong.

  2. With the Creators Update, even if I don't resize, if I open nano and type a bunch of text, winpty goes horribly wrong. Is this the new double-width bug in Windows? I don't think so?

  3. With WSL nano, but not vim, winpty seems to be unable to resize the window/buffer. It tries to, but the operations don't take effect? This issue appears in v14393.

Probably safe to ignore:

  1. There's a bug with WSL nano, where if I type a long line of text, eventually nano scrolls just the current line to the left (and moves the cursor to the left also). When it does, it fails to clear the line after the cursor. This bug happens with the console; it's not related to winpty. It's presumably a bug in WSL and/or nano. nano works fine with wslbridge.
@rprichard
Copy link
Owner Author

I'm abusing the bug tracker a bit here, but here are two more non-winpty examples where the cursor wraps back around while entering a line:

  1. Python2 and Python3 on Ubuntu 16.04, as well as Homebrew Python 3.6.1 on OS X. Start the Python REPL, then run import os; os.system("bash"), make the terminal wider, exit bash, then try to type a very long line.

  2. Cygwin bash with mintty or xterm. Start a bash subshell, make the terminal wider, exit bash, then try to type a very long line.

I'd guess that, before beginning to read a line, programs need to query the current terminal width, because maybe SIGWINCH is only sent to foreground processes? There are plenty of other examples of software that isn't broken. This bug doesn't affect: bash on Ubuntu 16.04, the built-in Python2 on OS X, ghci or utop on Ubuntu 16.04.

@rprichard
Copy link
Owner Author

Issue 2 is #112, which I have a fix for.

I haven't been able to reproduce issue 3, so now I think I must have been resizing nano, which is issue 4.

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

No branches or pull requests

1 participant