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 in gitbash on windows terminal kills ssh remote sessions #12431

Closed
avasant21 opened this issue Feb 8, 2022 · 35 comments
Closed

ctrl+c in gitbash on windows terminal kills ssh remote sessions #12431

avasant21 opened this issue Feb 8, 2022 · 35 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase

Comments

@avasant21
Copy link

Windows Terminal version

1.11.3471.0

Windows build number

10.0.19043.0

Other Software

Gitbash - mintty 3.5.2

Steps to reproduce

  1. Added the gitbash as default profile in Windows Terminal
  2. Logged into ssh remote systems
  3. Pressing ctlr+c(keyboard interrupt) kills the remote sessions and brings the prompt back to git bash

This behavior is not observed when directly running on Gitbash terminal

Expected Behavior

ctlr+c should just interrupt the current process not the sessions

Actual Behavior

Pressing ctlr+c(keyboard interrupt) kills the remote sessions and brings the prompt back to git bash

@avasant21 avasant21 added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 8, 2022
@msftbot msftbot bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 8, 2022
@fredrik-corneliusson
Copy link

Bug is also discussed in git for windows:
git-for-windows/git#3657 (comment)

@akulbe
Copy link

akulbe commented Feb 17, 2022

Okay, I thought this issue was with my keyboard. This is happening here multiple times per day, and it's making me crazy. 🤪

@poonsakn
Copy link

poonsakn commented Apr 8, 2022

This also happen to me when using puTTY via plink command.

Windows Terminal
Version: 1.11.3471.0

@zadjii-msft
Copy link
Member

huh, so this is like the opposite of #8034

@macdjord
Copy link

I've been seeing this every since I updated from git version 2.35.1.windows.2 to git version 2.36.0.rc0.windows.1.

Also, I've noticed something odd: after accidentally killing an SSH session in this way, the terminal stops echoing characters when I type them.

@aschaepper
Copy link

Got the same behavior but also with the older Git Version:
git version 2.35.1.windows.2
It only hapens in the git shell, other shells like powershell work.

Also the keyboard buttons home and end seem to behave weird, but only on some kind of target machines (ARM/Yoctolinux/Busybox in my case) on Ubuntu 20 home and end works. but Ctrl-c also closes the connection.

Running windows Terminal 1.12.10733.0 from the store on:
Windows 11:
21H2
OSBuild: 22000.593
Windows Feature Experience Pack 1000.22000.593.0

Reinstalled Windows Terminal, Reset the settings nothing worked so far.

@WereCatf
Copy link

I noticed this bug a while ago already and haven't found a fix for it. So far I've stuck to 2.34.1, because I really need SSH and ctrl+c to work.

Would be nice to know, if the issue is caused by Windows Terminal or Gitbash, though.

@kennyhyun
Copy link

ssh in Command Prompt (on Windows Terminal) has no such issue

@joaommartins
Copy link

Seems to be fixed in git version 2.36.0.windows.1, running on Windows Terminal build 1.12.10982.0.

@zadjii-msft
Copy link
Member

@joaommartins that's great to hear! I had a sneaking suspicion this was a git bash issue, but I was having a hard time tracking this down.

Can any other folks confirm/? Hopefully we can just close this one out ☺️

@msftbot msftbot bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 26, 2022
@WereCatf
Copy link

I can confirm, works fine with 2.36.0 again.

@zadjii-msft zadjii-msft added the Resolution-External For issues that are outside this codebase label Apr 26, 2022
@Throbac-Labs
Copy link

im runnning git version 2.36.0.windows.1 and still seeing this issue. Should i attempt a rollback? or uninstall and re-install git?

@ijin82
Copy link

ijin82 commented May 9, 2022

Same for me. That's awfull.

@jeefs
Copy link

jeefs commented May 18, 2022

marked

@MiguelBamberino
Copy link

I am on 2.36.1.windows.1 and still getting issue,

@ijin82
Copy link

ijin82 commented Jul 12, 2022

I am on 2.36.1.windows.1 and still getting issue,

just upgraded (chocolatey) to microsoft-windows-terminal 1.14.1861.0 + git 2.37.0
works fine (resolved)

@OrlinAlvarado
Copy link

I'm having the same issue, but only when using Git Bash. In the PowerShell and CMD, it works correctly.

Any idea?

@boly38
Copy link

boly38 commented Jul 13, 2022

@OrlinAlvarado not sure that everyone noticed the workaround quoted in git-for-windows/git/issues/3657 and that worked for me

export MSYS=enable_pcon

@OrlinAlvarado
Copy link

@OrlinAlvarado not sure that everyone noticed the workaround quoted in git-for-windows/git/issues/3657 and that worked for me

export MSYS=enable_pcon

Hi, @boly38 I added what you suggested, but CTRL+C, exit my ssh session.

@Shenmin-Z
Copy link

@rdoering it's not in the store, but if you are asking when will an official Git for Windows be available with this fix: It is now. https://github.com/git-for-windows/git/releases/tag/v2.36.0.windows.1

@OrlinAlvarado 2.36.0 works.

@rdoering
Copy link

@Shenmin-Z thanks

@0xaead
Copy link

0xaead commented Aug 14, 2022

I rolled back till https://github.com/git-for-windows/git/releases/tag/v2.32.0.windows.1 to solve this issue. What a long and winding road.

@83leej
Copy link

83leej commented Aug 25, 2022

reverted back to 2.30.0 to get this to work again

@OrlinAlvarado

This comment was marked as off-topic.

@aschaepper
Copy link

Perfect, works with new Version of Git! 2.38

@Eugene-Melbourne
Copy link

Eugene-Melbourne commented Nov 6, 2022

It really depends on the SSH connection. For example

The latest one (gitbash v2.38.1) is working fine with SSH connections to AWS EC2 instances.

But it does not work with Vagrant (Oracle VM).
To work with Vagrant (Oracle VM) the working options would be

@matthiasbannach
Copy link

For me it happen when I have X-Forwarding enabled (e.g. -Y or -X) or the equivalent setting in .ssh/config.

Without it - no problems.

@zehawki
Copy link

zehawki commented Dec 2, 2022

This issue made Windows terminal quite useless for me, and I always thought this was a Win Term issue. This thread made me realise that the culprit could be git bash. Problem seems to have gone away for SSH to AWS EC2 (my usecase) with gitbash v2.38.1.

@sanviler
Copy link

still happening in version 2.39.0.windows.1 using vagrant

@robert-lill-tie
Copy link

Had the same issue with 2.35.0, updated to 2.39.0(2), now it's working fine.

@karmendra
Copy link

I had new installation of windows 10 and updated it. Installed git version 2.39.0.windows.2 and it is not working as expected Ctrl+C exits me out of the ssh session and returns to git-bash prompt. vagrant is running the guest machine on virtualbox in my case.

@rai-streamline
Copy link

2.39.1 still happening

@yuvaramachandran-gurusamy

This issue still observed in Git-2.39.0.

@milkpirate
Copy link

Dito, really annoying! 😭

@blakeduffey
Copy link

This still seem to be an issue on git 2.40.0, OpenSSH_9.2.p1

This also happens with these versions of git/OpenSSH using a vanilla powershell window. after connecting via ssh, issuing a CTRL-C (which is muscle memory to end interrupt the remote task) results in

client_loop: send disconnect: Broken pipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests