WSL: CTRL+Z doesn't work in Bash
Issue: In Windows 10 Insider build 15002, when running Bash.exe, CTRL + <key> chords are not being correctly handled by the Windows Console.
Effect: Users will be unable to terminate Linux apps using CTRL + C, or background running tasks using CTRL + Z, etc. When CTRL + C is hit in Bash, a ‘c’ is displayed in the bash console.
Work-Around(s): Until fixed:
- Run Linux tools that require CTRL + C to terminate in a separate Bash console session; these individual bash consoles can then be closed when needed without disrupting your interactive bash consoles
- Map an alternate key to Ctrl+C. For example, to map Ctrl+K to Ctrl+C run:
stty intr \^k. This mapping is per terminal and will have to be done every time bash is launched. Users can include this in their .bashrc if preferred
Scope: This issue only affects Bash sessions and does not prevent CTRL + C, etc. in other console apps or shells (i.e. Cmd or PowerShell).
For more information on this release, including the many other fixes it DOES include, be sure to read the build 15002 Release Notes.
We apologize for this annoying issue. A fix has been checked-in and will be released ASAP into an up-coming Insiders build.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 42
- Comments: 52 (16 by maintainers)
Still works like a charm under wsl-terminal https://github.com/goreliu/wsl-terminal 😉
I’m hoping next week’s build has the fix.
What can I say but “squee!” 😉
Thanks!
Bash On Ubuntu On Windows provides the tools that allow an unmodified Windows installation to be used where a Linux or MacOS OS would be needed. I have personally been very outspoken in the field of astrophysics and astronomy that MS is committed to supporting researchers, as evidenced by their involvement and iterations on issues and features.
As on example, the Cloudy Developers group (nublado.org) now support use of their widely distributed open sourced code with BoUoW. However, these types of “problems” prevent the lead authors from fully endorsing using Windows. The team has to answer to many thousands of current users, and the OS can not get in the way of the code. Being able to reliably execute know, expected basic hot-keys is fundamental to users seeing BoUoW as a viable option to work. The optics of fixing a bug like this are bad at a crucial time when cautious and skeptical users have renewed interest in Windows.
Thank you.
@giech - We are tracking this bug for Patch Tuesday. But general bugs and feature work will only be available through the Insider program (it’s a case by case basis). The Ctrl+Z fix is going through the vetting process to get in the patch Tuesday. Difficult to give any ETA’s because most of that process is outside our team. We do apologize for the inconvenience this bug has caused.
Thanks all for chiming in. The bug has been approved for Creators Update servicing.
tfw 15014 broke my xbox controller though >.< ( just a warning, it’s a known issue )
chshhas worked since summer of 2017.I realized that the problem was probably not a bug in bash on Windows. Instead of running bash, I’m exec’ing mksh (wish there were a way to chsh). And that means that the original bash process is not an interactive one, thus it doesn’t ignore SIGINT. Mksh is passing SIGINT on to the the bash process instead of ignoring it (this is probably either a bug in or an enhancement to mksh) when it’s exec’ed.
I was able to work around the problem by inserting ‘trap “echo” INT’ into my mksh startup script.
Also, Ctrl-Z does the right thing: by “does nothing,” I meant that it didn’t close the terminal window the way Ctrl-C did. Ctrl-Z on a running process correctly backgrounds the process.
Many thanks for prodding me to think about the issue a bit more. 😉
@davidmaxwaterman - Possibly. The fix has to go through the test cycle of the servicing process. I know the fix is on it’s way out. Probably, by the end of the month. Thanks for your patience.
@davidmaxwaterman - We have found the bug. We are prioritizing it and working to get it fixed. Apologies for breaking such a basic scenario.
Fixed in 15014 it seems. Thank you!