-
Notifications
You must be signed in to change notification settings - Fork 772
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 broken #914
Labels
Comments
Following up with the conhost team... |
Cool, please update this thread if you can when you have an answer from them - the node-pty and winpty issues where I referenced this affect the vscode integrated terminal (same issue - Ctrl-C does nothing) which I'd like to fix. |
bagajjal
added
Issue-Discussion-Deprecated/use GitHub discussions
and removed
Issue-Bug
labels
Feb 9, 2018
Closed
It's fixed. Verified this in the windows Version 10.0.19041.172. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
0.0.21.0
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Windows 10 Pro
Client OperatingSystem
macOS High Sierra via iTerm2 and zsh
What is failing
Using Ctrl+C to cancel an input line in both PowerShell and cmd.
Expected output
Actual output
This is a real pain point for me because I've spent hours disassembling cmd and conhost trying to figure out how to trigger this to fix winpty, with limited success, but still haven't entirely got it. I highly recommend that being at MS, you look at the code for cmd and conhost and base your implementation on that, because it's very particular about what it accepts. Here's what I know:
GenerateConsoleCtrlEvent
doesn't trigger either cmd or PowerShell. It does, at least for me, trigger other programs (e.g. it quits node). For aTerminate batch job
prompt, it prints^C
but doesn't quit the batch file. This is your current implementation. You should probably continue calling this along with whatever triggers the shells.^C
triggers PowerShell, but not cmd. This is because PSReadLine disables processed mode and handles all input itself. You have to set the vk code to'\x03'
and the ASCII/Unicode char to'C'
, otherwise it will just print^C
.CtrlEvent
handler that looks in the disassembly like it should trigger a line cancel, but it doesn't. Presumably I missed something there. Reading dissasembly is hard 🙁. Writing the^C
character just prints^C
to the console. None of the various console modes I've tried fix this. I've also tried separate programs withAttachConsole
and spawning cmd with different flags. It's very stubborn.^C
in the input, but I could never get this working. I know it handles piped input different fromCONIN$
input, so that might be what I was seeing. It also looks like it callsGetKeyboardState
rather than checking for a control down message.WM_KEYDOWN
to the window works reliably - it's the only thing that does, but I don't know how that would work under sshd.The text was updated successfully, but these errors were encountered: