You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any other interesting things about your environment that might be related
to the issue you're seeing?
No
Details
When running an SSH command, hitting CTRL-C sends SIGINT to the remote process instead of terminating the SSH command, as expected. However, in 2.36.1.windows.1, if you sent at least one CTRL-C during an SSH session, then, once the SSH session ends but before the SSH command terminates, the SSH command will receive an interrupt:
REDACTED@REDACTED MINGW64 ~
$ ssh dev
Last login: Tue May 10 16:42:30 2022 from 10.0.132.5
[foo@bar-dev-12 ~ DEV12 ]
$ ^C
[foo@bar-dev-12 ~ DEV12 ]
$ ^C
[foo@bar-dev-12 ~ DEV12 ]
$
[foo@bar-dev-12 ~ DEV12 ]
$ exit
logout
Connection to 10.0.25.209 closed.
Traceback (most recent call last):
File "C:/Users/REDACTED/source/ssh-wrappy.git/bin/ssh", line 358, in <module>
res = main()
File "C:/Users/REDACTED/source/ssh-wrappy.git/bin/ssh", line 350, in main
ret = subprocess.call(cmd)
File "C:\Users\REDACTED\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 325, in call
return p.wait(timeout=timeout)
File "C:\Users\REDACTED\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 990, in wait
return self._wait(timeout=timeout)
File "C:\Users\REDACTED\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1230, in _wait
timeout_millis)
KeyboardInterrupt
REDACTED@REDACTED MINGW64 ~
$ echo $?
1
Note: ssh-wrappy.git/bin/ssh is a Python wrapper around ssh.exe which we use to automatically translate certain server names into their addresses. dev, however, is not one of those special servers.
If CTRL-C is not used during the SSH session, it terminates cleanly instead:
REDACTED@REDACTED MINGW64 ~
$ ssh dev
Last login: Tue May 10 16:42:59 2022 from 10.0.132.5
[foo@bar-dev-12 ~ DEV12 ]
$ exit
logout
Connection to 10.0.25.209 closed.
REDACTED@REDACTED MINGW64 ~
$ echo $?
0
If I bypass the wrapper script, the same thing happens, just less obviously without Python's exception traceback:
REDACTED@REDACTED MINGW64 ~
$ /bin/ssh dev
Last login: Tue May 10 16:46:01 2022 from 10.0.132.5
[foo@bar-dev-12 ~ DEV12 ]
$ ^C
[foo@bar-dev-12 ~ DEV12 ]
$ exit
logout
Connection to 10.0.25.209 closed.
REDACTED@REDACTED MINGW64 ~
$ echo $?
130
REDACTED@REDACTED MINGW64 ~
$ /bin/ssh dev
Last login: Tue May 10 16:50:21 2022 from 10.0.132.5
[foo@bar-dev-12 ~ DEV12 ]
$ exit
logout
Connection to 10.0.25.209 closed.
REDACTED@REDACTED MINGW64 ~
$ echo $?
0
What did you expect to occur after running these commands?
CTRL-C sent to SSH should affect only the remote command.
What actually happened instead?
CTRL-C affected both the remote command & the SSH command.
Notes
2.34.1behaved correctly - CTRL-C affected only the remote command
Just reinstalled 2.34.1.windows.1 and tested this. While the Python script doesn't produce a KeyboardInterrupt, if I run SSH directly, I still get exit code 130.
Setup
defaults?
to the issue you're seeing?
No
Details
When running an SSH command, hitting CTRL-C sends SIGINT to the remote process instead of terminating the SSH command, as expected. However, in
2.36.1.windows.1, if you sent at least one CTRL-C during an SSH session, then, once the SSH session ends but before the SSH command terminates, the SSH command will receive an interrupt:Note:
ssh-wrappy.git/bin/sshis a Python wrapper aroundssh.exewhich we use to automatically translate certain server names into their addresses.dev, however, is not one of those special servers.If CTRL-C is not used during the SSH session, it terminates cleanly instead:
If I bypass the wrapper script, the same thing happens, just less obviously without Python's exception traceback:
CTRL-C sent to SSH should affect only the remote command.
CTRL-C affected both the remote command & the SSH command.
Notes
2.34.1behaved correctly - CTRL-C affected only the remote command2.34.1.windows.1and tested this. While the Python script doesn't produce aKeyboardInterrupt, if I run SSH directly, I still get exit code 130.2.36.0.rc0.windows.1had a similar but worse bug where CTRL-C during an SSH session would immediately kill the SSH command ( ctrl+c in gitbash on windows terminal kills ssh remote sessions microsoft/terminal#12431 )