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 doesn't terminate process or clear the line #7

Closed
Tyriar opened this issue Nov 11, 2016 · 52 comments
Closed

Ctrl-C doesn't terminate process or clear the line #7

Tyriar opened this issue Nov 11, 2016 · 52 comments
Labels
bug Issue identified by VS Code Team member as probable bug windows
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Nov 11, 2016

From microsoft/vscode#15249

  • VSCode Version: 1.7.1
  • OS Version: Windows 8.1

Steps to Reproduce:

  1. "terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
  2. Ctrl-C doesn't work for terminating a process (such as cordova run).
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug windows labels Nov 11, 2016
@Syllinger
Copy link

Also having an issue with Ctrl-C where the current process is not halted, instead the terminal is closed/crashes and all running processes exit in unison.

  • VSCode Version: 1.7.1
  • OS Version: Windows 10 Home

@Tyriar
Copy link
Member Author

Tyriar commented Nov 17, 2016

@Syllinger If you see that again can you go to Hep > Toggle Developer Tools, open the console and grab a screenshot and/or paste the error?

@Tyriar
Copy link
Member Author

Tyriar commented Jan 18, 2017

Sending ^C to gulp watch sometimes seems to do nothing, however ^C does work in general. Not sure why atm.

@melgish
Copy link

melgish commented Feb 7, 2017

Observed similar behavior running live-server. Also noticed that sometimes CTRL-C works but only after a lengthy timeout.

@CherryDT
Copy link

CherryDT commented Apr 21, 2017

As mentioned in the VSCode issue already: This happens to everybody in our company as well. However it also happens to outside VSCode, I have to add. We use ConEmu, so maybe the issue exists in general with the combination of Git Bash, npm/node and non-default console emulators?

This makes me wonder who is really at fault here, it could be very well the MSYS bash or node for Windows...

@CherryDT
Copy link

In fact it sounds like Maximus5/ConEmu#402 and git-for-windows/git#227

@vladbalanescu
Copy link

Any updates on this issue guys? I am currently running a continuous Casper script in my bash shell on Windows and I cannot stop the execution other than after finishing the promise chain execution.

@IanOvenden
Copy link

Hey @vladbalanescu - although not perfect within VSCode, I did find that upgrading to latest version of Node allowed me to terminate most processes 👍

@vladbalanescu
Copy link

Hey @IanOvenden which version of node are you using? I am currently on 7.10 and whenever I am running a casperjs script I cannot stop it unless it finished execution and the promise chain finished returning

@IanOvenden
Copy link

@vladbalanescu - I'm currently running on version 6.11.1, which is the latest stable release. At the time I was having issues, I was on 4.x.x and upgraded to an early version of 6 - I can't remember exactly which versions I moved from.

@tateman74
Copy link

Getting the same thing guys with a node or nodemon process. Dies and leaves the process running. I'm running Node 8.2.1 so there is no fix with a node upgrade. This is a Bash issue with Windows 10 only. I'm going to have to use a different shell now as I can't keep hunting down the node process to kill it.

screen shot 2017-08-01 at 11 07 49 am

@Mellbourn
Copy link

Mellbourn commented Mar 24, 2018

I think I have the same issue in tmux terminal inside VSCode on MacOS.

I have the setup that was described by João Moreno (@joaomoreno) in his blog post https://medium.com/@joaomoreno/persistent-terminal-sessions-in-vs-code-8fc469ed6b41

However, it seems to me that Control-C, does not work as good as it used to.

It is particularly noticeable when I run nodemon. When I run it in tmux in iTerm, I can exit the run without problem by using Control-C. If I run nodemon inside tmux inside VSCode, I cannot. Instead it just renders ^C in the terminal window.

  • VSCode Version: 1.21.1 and 1.22.1-insiders b75321329388d74e34f79dcfcb789246e31836a8
  • OS Version: MacOS 10.13.3

Does this issue occur when all extensions are disabled?: Yes

@Tyriar
Copy link
Member Author

Tyriar commented Mar 27, 2018

@Mellbourn that's definitely not this issue as this is Windows only, we can follow up in a VS Code issue if you want to create one https://github.com/Microsoft/vscode

@Mellbourn
Copy link

@Tyriar Right. I've reported the problem here now: microsoft/vscode#46731

@dieselVtwin
Copy link

Hi all,
I just bumped into this issue, but without VS Code involved in the mix.

If this is only an issue on Windows platforms, as @Tyriar states, then I think it is actually under VS Code and in the Bash shell included in GIT for Windows. It's discussed in issue 1491.
git-for-windows/git#1491

A Linux engineer that I worked with helped this poor Windows engineer to work around it with the magical phrase, "stty echo", to turn the keyboard echo back on.

Cheers,
dVt

@Abdurraheem
Copy link

Abdurraheem commented Jul 2, 2018

I had the same issue.
GitBash - git version 2.16.2.windows.1

When I use e.g. git log command and press ctrl+c the console is stuck. I could type, but no command are typing. However, after press enter the command is running.But I got solution ,after git log , press wq to exit from the log and now my console cursor is visible and and command is also visible now.

@parkovski
Copy link

Hey @Abdurraheem I believe that’s actually a git bug, try killing all processes named less after you get out of the git log.

@haxor211
Copy link

So it this ever gonna get fixed? Or Im doomed to use taskkill /im node.exe /f forever?

@Tyriar
Copy link
Member Author

Tyriar commented Jul 16, 2018

@haxor211 I'm hoping the fix for microsoft/vscode#45693 will do the trick, I'll be working on that probably in the next few months.

@Tyriar Tyriar removed the help wanted Issues identified as good community contribution opportunities label Jul 17, 2018
@saostad
Copy link

saostad commented Aug 10, 2018

I have same problem with git bash, but after press ctrl+c, if I wait like 5 minutes it will stop the "npm start" process for me.
I am using create-react-app typescript package
but if I use "docker-compose up" to run my docker container after I press ctrl+c it stop the container without problem.

@saostad
Copy link

saostad commented Aug 13, 2018

I find what was my problem.
for some reason I had this in my settings:
"terminal.integrated.rendererType": "dom"
after I remove it it start working and it's much faster

@pikilon
Copy link

pikilon commented Aug 16, 2018

"terminal.integrated.rendererType": "dom"

False alarm, it doesn´t make it more responsive.

@gpmetheny
Copy link

gpmetheny commented Oct 8, 2018

@Abdurraheem @SharakPL @sashberd

I had the same issue.
GitBash - git version 2.16.2.windows.1

When I use e.g. git log command and press ctrl+c the console is stuck. I could type, but no command are typing. However, after press enter the command is running.But I got solution ,after git log , press wq to exit from the log and now my console cursor is visible and and command is also visible now.

I was having the same problem specifically with git log, but that's because it uses less. I didn't try wq, but I'm exiting cleanly using q (NOT ctrl + q). Able to continue typing commands as normal.

*** answer found here ***

@Tyriar Tyriar mentioned this issue Oct 19, 2018
5 tasks
@Tyriar Tyriar added this to the 0.8.0 milestone Dec 21, 2018
@NischalSehrawat
Copy link

CTRL+ALT+M

@luohong123
Copy link

I am experiencing the same problem, when I press CTRL+C, the editor unexpectedly quits, appears 3221225786, my solution is to upgrade the git tool, the following is my git version

git --version
// git version 2.23.0.windows.1

The issue has been resolved after the upgrade

@tohagan
Copy link

tohagan commented Nov 21, 2019

If you start another bash shell inside the bash started by VSCode then I found that apps you start in the inner shell DO respond to Ctrl-C.

@rileyhemp
Copy link

rileyhemp commented Jan 28, 2020

If you're still experiencing this, run git update-git-for-windows

@FiruzzZ
Copy link

FiruzzZ commented Feb 26, 2020

I have this issue with 2.25.1 (just updated from 2.25.0) to check if it was already fixed but no.
CTRL+C on Gitbash works with commands like:
ping xxx.xxx.xxx //t
but doesn't work with git log or git diff, I have to press ENTER a few time after pressing CTRL+C and even after this, it takes a few seconds to the interrupt the command

Update: just pressing Q does the trick, this was always possible? I didn't know

@Tyriar
Copy link
Member Author

Tyriar commented Feb 26, 2020

@FiruzzZ fyi in bash, git log/diff aren't meant to exit with ctrl+C,.

@setebe
Copy link

setebe commented Mar 1, 2020

The temporary solution for me:

image

@SharakPL
Copy link

SharakPL commented Mar 2, 2020

@setebe I think much better solution is to simply remember to use Q instead of Ctrl C in scrollable parts like git log output. Besides I've just checked and using Ctrl C while viewing git log does nothing in powershell and cmd. You must use Q to quit log so this has been fixed already.

I'm using Git for Windows 2.25.1.windows.1 (64bit)

@setebe
Copy link

setebe commented Mar 2, 2020

@SharakPL I've downgraded to version 2.8.1 and ctrl+c starts to work.

@Tyriar
Copy link
Member Author

Tyriar commented Mar 2, 2020

ctrl+c is not meant to work in git log/diff, downgrading is not recommended as you'll probably hit other bugs that have been fixed in it. Anyway this issue is long fixed with the move to conpty so this discussion is off topic.

@microsoft microsoft locked as off-topic and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug windows
Projects
None yet
Development

No branches or pull requests