WSL: Ctrl-C doesn't work in any conhost to cancel the currently typed command.
Not A Duplicate. Please read.
I understand #1569 reports an issue with Bash, but it’s normal for me when typing in a terminal to use “Ctrl-C” to cancel the currently typed command and clear the current input.
Right now Ctrl-C doesn’t behave correctly in any console that uses conhost, and I’m not sure where to report that. e.g.: powershell. (I guess this works now for me in cmd, but was not earlier. I may have changed something since my first report or I may be mistaken in it effecting all conhosts and imagined it affecting cmd.)
Steps to reproduce:
Steps:
- Type “foobar” into a
powershellprompt. - Press Ctrl-C
Expected behavior:
Input is cleared.
Actual behavior:
Nothing happens.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 8
- Comments: 16 (3 by maintainers)
With 15031 it started to work again
I am on 15014, and ctrl-c in PS is working for me now.
You can’t start typing a command then ctrl-c out if it, but ctrl-c works once something is running which is expected behavior. I really can’t say for sure if PS ever supported ctrl-c out of what you’ve typed like you can in bash. I’ll let the devs comment on that.
@jackchammons it was rude to close my previous issue (#1581) as a duplicate of #1569 when I mentioned #1569 in the very first line.
In build 15014, Ctrl + C is fixed in bash and cmd but not for PS. Bash launched from PS works fine, just not PS itself.
+1 tested with PS, cmd.exe and bash in Windows 10 Insider build 15007, used the default console as well as ConEMU. Ctrl-C works in cmd.exe and bash but not in PS using both console applications. Note that ctrl-c works in bash and cmd.exe even when they are launched from PS.
I am pretty confident this didn’t begin with build 15002. I noticed this behavior with PowerShell in the previous Fast Insiders build released before the holidays. Hopefully, this is somewhat useful information.
You are right, your original issue should not have been closed. In our defense we have been expecting a huge influx of “control c is broken” issues being filed as a result of this bug. At a glance your issue looked to be a duplicate, sorry about that.
What you are describing is definitely something else broken in the core console code and should certainly be investigated.
And I don’t know why I feel like I must clarify this, but let me quote to you exactly why this isn’t a duplicate. Here’s issue #1569:
My issue: Ctrl-chords are not behaving as expected in
powershelleither.In
powershella different behavior occurs: nothing happens at all.Obviously this does not work for
powershellorcmd.This is affecting me in
powershell.exe.