Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl+C does not stop node server in Command Line from VS Code

From a normal Windows command prompt, ctrl+c will stop a node server running.

However, if I start the command prompt via the VS Code menu item Open in Command Prompt, then pressing ctrl+c (even multiple times) does not stop the server as usual.

Any idea what is different in the VS Code command prompt compared to the standard windows command prompt?

(Running on Windows 10 x64) (VS Code 1.11.2)

like image 217
RaelB Avatar asked Apr 21 '17 00:04

RaelB


2 Answers

In VS Code you will see a pull-down menu at the top of the terminal in the right corner. If you are in a running node app and want to close it or you are "stuck" the pull-down menu should say node. Click the trashcan (kill terminal) next to the list to close the running node app. You should be returned to the terminal unless you have something else running like another node app. Select bash, powershell, etc from the pull-down menu to navigate back to your command line.

enter image description here

like image 168
Will Mangimelli Avatar answered Oct 27 '22 21:10

Will Mangimelli


I had the same problem as OP, and RaelB's answer didn't help.

What I did was "disallowed chords" by going to the User Settings (Ctrl + Alt + S on Windows) > User Tab (not Workspace tab) > Features > Terminal and unchecked the Integrated: Allow Chords checkbox.

Now I can use my terminal as I would use a regular Windows terminal.

Here's an image of the settings: enter image description here

like image 32
Filip Savic Avatar answered Oct 27 '22 21:10

Filip Savic