Ctrl+c doesn't work after have used ssh in Powershell in the same terminal session #17926

Closed
opened 2026-01-31 05:58:44 +00:00 by claunia · 8 comments
Owner

Originally created by @jacobrastad on GitHub (Jul 14, 2022).

Windows Terminal version

1.13.11432.0

Windows build number

10.0.22000.0

Other Software

Using ssh.exe

ssh.exe -V
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

Steps to reproduce

  1. Login/try to login with SSH on any remote host that accepts ssh connections. Then exit that.
  2. Run ping 8.8.8.8 -t
  3. Try to exit with ctrl+c

Update
The issue only appears if the ssh-session ends with some sort of error (like pressing ctrl+c when trying to connect). If I connect successfully and exits the ssh-session with exit command. Everything works as normal.

Expected Behavior

The ping-action should stop

Actual Behavior

Nothing happens, the continuous ping keeps going.

Tried ctrl+break which prints out a new empty line briefly. But it doesn't exit the running operation and the pingin keeps going.

Other info

Other possibly related issues

Print screen of repro steps

image
Originally created by @jacobrastad on GitHub (Jul 14, 2022). ### Windows Terminal version 1.13.11432.0 ### Windows build number 10.0.22000.0 ### Other Software Using `ssh.exe` ``` ssh.exe -V OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 ``` ### Steps to reproduce 1. Login/try to login with SSH on any remote host that accepts ssh connections. Then exit that. 2. Run ping 8.8.8.8 -t 3. Try to exit with ctrl+c **Update** The issue only appears if the ssh-session ends with some sort of error (like pressing ctrl+c when trying to connect). If I connect successfully and exits the ssh-session with `exit` command. Everything works as normal. ### Expected Behavior The ping-action should stop ### Actual Behavior Nothing happens, the continuous ping keeps going. Tried ctrl+break which prints out a new empty line briefly. But it doesn't exit the running operation and the pingin keeps going. ### Other info Other possibly related issues - https://github.com/microsoft/terminal/issues/6258 - https://github.com/microsoft/terminal/issues/8034 #### Print screen of repro steps <img width="813" alt="image" src="https://user-images.githubusercontent.com/6196028/178973951-0b22ece7-fbe7-40ca-ad31-9e019180ae41.png">
claunia added the Issue-BugResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 05:58:44 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 14, 2022):

Which ssh are you using? ssh.exe that ships with Windows? ssh from a WSL distro? Or some other ssh? And which version of ssh/?

Does the same thing happen in a vintage console window (conhost.exe)?

@zadjii-msft commented on GitHub (Jul 14, 2022): Which `ssh` are you using? `ssh.exe` that ships with Windows? `ssh` from a WSL distro? Or some other `ssh`? And which version of `ssh`/? Does the same thing happen in a vintage console window (conhost.exe)?
Author
Owner

@jacobrastad commented on GitHub (Jul 14, 2022):

@zadjii-msft I've updated the description with the info

ssh.exe -V
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

No issue using conhost.exe , there it works as expected

@jacobrastad commented on GitHub (Jul 14, 2022): @zadjii-msft I've updated the description with the info ``` ssh.exe -V OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 ``` No issue using `conhost.exe` , there it works as expected
Author
Owner

@zadjii-msft commented on GitHub (Jul 14, 2022):

This looks a bit like
https://github.com/PowerShell/Win32-OpenSSH/issues/1699

but

No issue using conhost.exe , there it works as expected

scares me, for sure.

@zadjii-msft commented on GitHub (Jul 14, 2022): This looks a bit like https://github.com/PowerShell/Win32-OpenSSH/issues/1699 but > No issue using `conhost.exe` , there it works as expected scares me, for sure.
Author
Owner

@zadjii-msft commented on GitHub (Jul 14, 2022):

Does this work in a Command Prompt tab, in the Terminal? Or the inverse, if you run powershell.exe in the vintage console, does this work there as well? (I'm just trying to work out the matrix of {conhost, Terminal}x{cmd.exe, powershell.exe}

@zadjii-msft commented on GitHub (Jul 14, 2022): Does this work in a Command Prompt tab, in the Terminal? Or the inverse, if you run powershell.exe in the vintage console, does this work there as well? (I'm just trying to work out the matrix of {conhost, Terminal}x{`cmd.exe`, `powershell.exe`}
Author
Owner

@jacobrastad commented on GitHub (Jul 14, 2022):

Running a cmd tab in the Terminal works as expected.

Starting a vanilla cmd and then running powershell in that produces the same issue.

@jacobrastad commented on GitHub (Jul 14, 2022): Running a `cmd` tab in the Terminal works as expected. Starting a vanilla `cmd` and then running `powershell` in that produces the same issue.
Author
Owner

@jacobrastad commented on GitHub (Jul 14, 2022):

After a bit more testing, the issue only appears if I exit the ssh-session with ctrl+c.

I.e if I

  1. Run ssh and connect successfully
  2. Exits the session by typing exit

Then everything works as normal. But if I get any error trying to connect, misstyping the password causing the session to terminate or pressing ctrl+c, then the issue appears.

@jacobrastad commented on GitHub (Jul 14, 2022): After a bit more testing, the issue only appears if I exit the ssh-session with ctrl+c. I.e if I 1. Run `ssh` and connect successfully 2. Exits the session by typing `exit` Then everything works as normal. But if I get any error trying to connect, misstyping the password causing the session to terminate or pressing ctrl+c, then the issue appears.
Author
Owner

@zadjii-msft commented on GitHub (Jul 14, 2022):

Okay great, thanks. All that would have me think that this is, in fact, https://github.com/PowerShell/Win32-OpenSSH/issues/1699, so I'm gonna close this to track the downstream issue. Thanks!

/dup https://github.com/PowerShell/Win32-OpenSSH/issues/1699

@zadjii-msft commented on GitHub (Jul 14, 2022): Okay great, thanks. All that would have me think that this is, in fact, https://github.com/PowerShell/Win32-OpenSSH/issues/1699, so I'm gonna close this to track the downstream issue. Thanks! /dup https://github.com/PowerShell/Win32-OpenSSH/issues/1699
Author
Owner

@ghost commented on GitHub (Jul 14, 2022):

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

@ghost commented on GitHub (Jul 14, 2022): Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17926