WSL: vi/vim.basic does not responds to keyboard input.

  • Your Windows build number: (Type ver at a Windows Command Prompt) 16193 Does not occur in 15063 and 16188.

  • What you’re doing and what’s happening: (Copy&paste specific commands and their output, or include screen shots) Launch vi does immediately hang. no longer responds. If killed vi process, returned terminal will not responds. But, react to kill -HUP. Does not occur using vim.tiny or vi -u NONE.

  • What’s wrong / what should be happening instead: Can edit file.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here) https://gist.github.com/0xbadfca11/00a1efe36b690dc1927fd844355a125e/raw/e1c50b41c59f594ab557ebb1ae73736e05366f08/strace.txt

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 5
  • Comments: 48 (11 by maintainers)

Most upvoted comments

@all - Thanks all for chiming in. With your support, the bug has been approved for fast-track.

If you don’t need fancy terminal features, setting TERM to something like vt100 works. E.g.:

TERM=vt100 vi ~/.bashrc

Don’t worry, we already have for this committed and on it’s way up 😃

@nickperry @Warblefly @mdavidsen & others: A polite notice:

I appreciate that this issue is a significant impediment at best, and a major PITA at worst, but I would like to point out that:

  1. As was pointed out above, this issue has been fixed.
  2. The fix is bubbling up our build tree and will emerge into insiders builds ~3 weeks after the fix is checked-in. Hopefully, it’ll be in the next fast-ring insiders build.
  3. We try to deliver fast-ring insiders builds most weeks.
  4. We do not service Insiders builds via Windows Update since that’s actually a slower process than delivering fast-ring builds, due to WU’s additional scrutiny & process overhead.

Also, its important to understand the following:

  1. Fast-ring Insiders builds are ~weekly snapshots of Windows as it is being built and, as such, the occasional issue/error will escape, despite our considerable efforts to not break users while we develop the next version of Windows. This is the cost you accept while signing-up for fast-ring updates.
  2. WSL itself is a beta feature, as clearly stated both in the optional components dialog image … and in the first-run distro setup process image

If you can tolerate a smaller amount of disruption, please adjust your settings to subscribe to slow-ring updates where fewer issues will appear.

If you cannot tolerate even a small amount of disruption, please do not use Insider builds: Fully released versions of Windows are likely your best option.

Thanks everyone for your support: Your bug reports and feedback is enormously valuable, but we do ask for a little patience and understanding as we progress through each release cycle.

@warpdesign If all goes according to plan, it’ll likely be in next week’s Insider fast-ring build. That’s as fast as it can move up and out.

For those complaining, DO NOT USE FAST RING IF YOU’RE UNWILLING TO SUFFER SOME CONSEQUENCES!!!

I look forward to this getting fast tracked.

I simply changes my term via an alias to get around it. Used nano for a bit too.

Good job Microsoft. Keep it up.

Found this after a lot of head-banging (including removing and reinstalling WSL). I’m using an alias to workaround this (alias v=‘TERM=vt100 vim’ - Thanks @aledell!). Would love for this to get bumped up in priority. I’m not looking forward to using emacs for a while. 😆

@warpdesign Yes this is a console change that broke this. We had a pretty high code delta that this bug was introduced in. These kinds of issues are expected with Insider’s builds.

I’m not positive that this will work, but based on what the fix for this bug was, it might be possible to get around this bug:

I believe that if you immediately start hitting a key on the keyboard after launching vi (eg, spamming ‘enter’), then you’ll avoid the bug case, and vi will work normally. It might not work on faster (normal) PC’s, but it does work on my VMs. The key is to have some input in the input queue as vi is launching.

@Warblefly - First, let me acknowledge that breaking vi is something that we are definitely not proud of. We understand the pain. The issue is fixed internally in our dev branch and we would like to fast-track it. But, we can use your and others help with that. If more people want the fix faster, its easier for us to justify the fast-track. So, if this is important to you and anyone else, please chime in here.

We are always happy to hear when someone tells us that WSL is useful within the education industry. And, we are glad you can use this as your daily driver.

@offero Considering the initial issue described by this thread was confirmed fixed over a year ago, what you’re seeing is almost certainly a new issue. Could you open a new issue on this repo to track and debug what you’re seeing now (rather than necro’ing an old thread)?

PS: fixed in today’s update!

We fixed an issue resulting in VIM being broken for Windows Subsystem for Linux (WSL) users in result flights. https://blogs.windows.com/windowsexperience/2017/06/08/announcing-windows-10-insider-preview-build-16215-pc-build-15222-mobile/

@djensen47 - It should be fixed in the next release. Sometimes things do get held up for reasons outside our direct control. Apologize for the delay and the inconvenience caused. And, thanks for your patience.

Here is a convenient summary of the workarounds. You can do this on the command line or update your ~/.bashrc

  1. Set the TERM to vt100 by @aledell
export TERM=vt100
  1. Create an alias for vim by @JoBrad

Do this if you don’t want to universally set the TERM to vt100.

alias v='TERM=vt100 vim'
  1. Set your default editor to something else or set the TERM env var to vt100
export EDITOR=nano
# or...
export EDITOR='TERM=vt100 vim'

I have a workaround because this bug has, unfortunately, become mission-critical this morning.

Use sshd.

  1. Start your Bash shell on Ubuntu under Windows as normal.
  2. Make the privilege separation directory for sshd: sudo mkdir /var/run/sshd
  3. Control its permissions: sudo chmod 0755 /var/run/sshd
  4. If you’re willing to use password authentication instead of public/private key, edit /etc/ssh/sshd_config to allow this (use the pico editor to change PasswordAuthentication from no to yes)
  5. Start sshd: sudo start-stop-daemon --start --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- -p 22

Now use something like PuTTY to log into localhost (127.0.0.1) and Vim, in all its colours, works. For the complete experience, change your PuTTY font to ‘Consolas’.

You will need to login with your Ubuntu on Windows username and password (i.e. the password with which you set-up Ubuntu on Windows when you first installed it). You did make a note of that password, didn’t you?

Bizarrely, the console as displayed by PuTTY.exe feels more responsive than the native console window.

Fair enough. I understand the release schedule is decided elsewhere. Just so you and the team know, I use this subsystem every day for compiling lots of code, and its output is a vital part of my work at a major British university. The compilation still works and I can use another editor beside vim for now. It’ll be nice when it’s back.