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

Ctrl-C doesn't work in any conhost to cancel the currently typed command. #1583

Closed
AaronFriel opened this issue Jan 11, 2017 · 16 comments
Closed
Labels

Comments

@AaronFriel
Copy link

AaronFriel commented Jan 11, 2017

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:

  1. Type "foobar" into a powershell prompt.
  2. Press Ctrl-C

Expected behavior:

Input is cleared.

Actual behavior:

Nothing happens.

@AaronFriel
Copy link
Author

@jackchammons it was rude to close my previous issue (#1581) as a duplicate of #1569 when I mentioned #1569 in the very first line.

@AaronFriel
Copy link
Author

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:

Issue: In Windows 10 Insider build 15002, when running Bash.exe, CTRL + chords are not being correctly handled by the Windows Console.

My issue: Ctrl-chords are not behaving as expected in powershell either.

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.

In powershell a different behavior occurs: nothing happens at all.

Work-Around(s): Until fixed:

  1. 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
  2. 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

Obviously this does not work for powershell or cmd.

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).

This is affecting me in powershell.exe.

@AaronFriel
Copy link
Author

CC @bitcrazed

@benhillis
Copy link
Member

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.

@jackchammons
Copy link
Contributor

@AaronFriel apologies for the preemptive closure. We'll be starting another repository in the future to deal with more console specific bugs like this.

@AaronFriel
Copy link
Author

Thank you, I appreciate that. It's understandable that you would expect an influx of issues, as well. I'm sure many would love to see a repository for general console bugs and improvements to conhost. This format works far better for technical issues than the feedback hub, in my opinion. 

@sgtoj
Copy link

sgtoj commented Jan 12, 2017

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.

@AaronFriel
Copy link
Author

Interesting, my desktop was unavailable for five weeks, from late November to a week ago, so I may not have been in PowerShell or noticed during that time.

@sameer
Copy link

sameer commented Jan 14, 2017

The issue also manifests when using adb shell through Command Prompt and Windows PowerShell.

Oddly enough, a single ctrl+c consistently creates 67 lowercase Cs:

Command Prompt
image

Windows PowerShell
image

@jwhipp
Copy link

jwhipp commented Jan 19, 2017

+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.

@sameer
Copy link

sameer commented Jan 20, 2017

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.

@jwhipp
Copy link

jwhipp commented Jan 20, 2017

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.

@apintocr
Copy link

apintocr commented Feb 6, 2017

I'm on 15025 and can't do CTRL+C on PowerShell (using ConEmu or using default shell).
Works on Bash and CMD.

@jaysonsantos
Copy link

With 15031 it started to work again

@KrunchMuffin
Copy link

I am on 15063.608 and I can't get CTRL+C to work in any PS, CMD or BASH. Is there another issue?

@bitcrazed
Copy link
Contributor

Thanks for the discussion.

Closing this issue since:

  1. This issue is very old and has likely been fixed in recent Win10 builds
  2. This is the WSL issues repo, but this is an issue in Console which has its own Console GitHub Repo
  3. GitHub doesn't allow issues to be moved between repos, preserving posters' identity :(

If you have further asks/issues, please file new issues on our Console GitHub Repo.

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

10 participants