Ctrl+c not working when pinging #8280

Closed
opened 2026-01-31 01:25:19 +00:00 by claunia · 10 comments
Owner

Originally created by @arefg on GitHub (May 19, 2020).

Ctrl+c not working when using ping

When pinging an IP, I can't cancel the ping using Ctrl+c and if I use "ping -t" there is no way of getting out of the ping except closing the entire tab on Windows Terminal.

Platform ServicePack Version VersionString


Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0

Windows Terminal Version: 0.11.1333.0

Originally created by @arefg on GitHub (May 19, 2020). Ctrl+c not working when using ping When pinging an IP, I can't cancel the ping using Ctrl+c and if I use "ping -t" there is no way of getting out of the ping except closing the entire tab on Windows Terminal. [Environment]::OSVersion Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0 Windows Terminal Version: 0.11.1333.0
claunia added the Resolution-ExternalNeeds-Tag-FixNeeds-Attention labels 2026-01-31 01:25:19 +00:00
Author
Owner

@DHowett commented on GitHub (May 19, 2020):

How did you start ping? Command Prompt? Windows PowerShell? WSL?

@DHowett commented on GitHub (May 19, 2020): How did you start ping? Command Prompt? Windows PowerShell? WSL?
Author
Owner

@arefg commented on GitHub (May 19, 2020):

Thank you for responding so quickly. I've checked it in cmd, PowerShell 7, PowerShell 5.1, and WSL. It seems that the problem is not specific to any of these shells, because the problem exists in one of my PowerShell 7 tabs but at the same time the other PowerShell 7 tab and other shells are fine. I've seen this behaviour over and over in the last month or so.

@arefg commented on GitHub (May 19, 2020): Thank you for responding so quickly. I've checked it in cmd, PowerShell 7, PowerShell 5.1, and WSL. It seems that the problem is not specific to any of these shells, because the problem exists in one of my PowerShell 7 tabs but at the same time the other PowerShell 7 tab and other shells are fine. I've seen this behaviour over and over in the last month or so.
Author
Owner

@hexnut commented on GitHub (May 20, 2020):

I was able to reproduce this bug, but only when when connected via RDP. The ping command does not respond to a ctrl-c in Powershell via an RDP session but works fine when testing locally.

@hexnut commented on GitHub (May 20, 2020): I was able to reproduce this bug, but only when when connected via RDP. The ping command does not respond to a ctrl-c in Powershell via an RDP session but works fine when testing locally.
Author
Owner

@DHowett commented on GitHub (May 22, 2020):

So, wow, this is crazy. I was only able to reproduce this after I've launched ssh once in the session.

If I press ^C while it's prompting for a password, ^C remains broken for the rest of the session forever.

Does that corroborate your findings?

@DHowett commented on GitHub (May 22, 2020): So, wow, this is crazy. I was only able to reproduce this after I've launched `ssh` once in the session. If I press ^C while it's prompting for a password, ^C remains broken for the rest of the session forever. Does that corroborate your findings?
Author
Owner

@Hallucine commented on GitHub (May 22, 2020):

So, wow, this is crazy. I was only able to reproduce this after I've launched ssh once in the session.

If I press ^C while it's prompting for a password, ^C remains broken for the rest of the session forever.

Does that corroborate your findings?

I can reproduce this fairly reliably using ssh and ssh-agent after pressing ^C at a password prompt. When it does stop working I found that terminating the ssh-agent process fixes it.

@Hallucine commented on GitHub (May 22, 2020): > So, wow, this is crazy. I was only able to reproduce this after I've launched `ssh` once in the session. > > If I press ^C while it's prompting for a password, ^C remains broken for the rest of the session forever. > > Does that corroborate your findings? I can reproduce this fairly reliably using `ssh` and `ssh-agent` after pressing ^C at a password prompt. When it does stop working I found that terminating the ssh-agent process fixes it.
Author
Owner

@oising commented on GitHub (May 22, 2020):

My guess is the masked input code for passwords is messing with ENABLE_PROCESSED_INPUT and crippling the break handler and it's not getting restored for some reason.

@oising commented on GitHub (May 22, 2020): My guess is the masked input code for passwords is messing with ENABLE_PROCESSED_INPUT and crippling the break handler and it's not getting restored for some reason.
Author
Owner

@arefg commented on GitHub (May 25, 2020):

@DHowett @Hallucine Exactly, I think this is what happens in my case either, pressing ctrl+c at a password prompt when using ssh produces this problem. I'm not sure if this is even related to Windows Terminal, because this exact behavior happens when using ssh in PowerShell 7 and PowerShell 5.1 without using Windows Terminal.

@arefg commented on GitHub (May 25, 2020): @DHowett @Hallucine Exactly, I think this is what happens in my case either, pressing ctrl+c at a password prompt when using ssh produces this problem. I'm not sure if this is even related to Windows Terminal, because this exact behavior happens when using ssh in PowerShell 7 and PowerShell 5.1 without using Windows Terminal.
Author
Owner

@DHowett commented on GitHub (May 29, 2020):

Based on all this, it seems like it's probably an OpenSSH issue. Thanks everyone for letting me know.
Might be worth filing on the upstream Microsoft OpenSSH fork. Better if it comes from a community member than from me! 😄

@DHowett commented on GitHub (May 29, 2020): Based on all this, it seems like it's probably an OpenSSH issue. Thanks everyone for letting me know. Might be worth filing on [the upstream Microsoft OpenSSH fork](https://github.com/powershell/win32-openssh). Better if it comes from a community member than from me! :smile:
Author
Owner

@xobs commented on GitHub (Feb 24, 2022):

This was reported to the Microsoft OpenSSH fork at https://github.com/PowerShell/Win32-OpenSSH/issues/1699

@xobs commented on GitHub (Feb 24, 2022): This was reported to the Microsoft OpenSSH fork at https://github.com/PowerShell/Win32-OpenSSH/issues/1699
Author
Owner

@gunthre commented on GitHub (Jun 16, 2022):

Sorry for reviving an old thread, but I just came across this and found a fix that might help others. Go into Properties (for an existing Powershell instance or a Powershell shortcut), Options tab, Edit Options. Uncheck "Enable Ctrl key shortcuts."

@gunthre commented on GitHub (Jun 16, 2022): Sorry for reviving an old thread, but I just came across this and found a fix that might help others. Go into Properties (for an existing Powershell instance or a Powershell shortcut), Options tab, Edit Options. Uncheck "Enable Ctrl key shortcuts."
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8280