I\'ve been stopping commands with the trash can for too long. Command period doesn\'t work on Mac. I can\'t find anywhere how to stop the terminal via a command. Anyone know wha
many of mac users (inclusive me) get mix with cmd and ctrl button. But ctrl+c should work fine.
You can kinda bypass the issue by writing, system("pause"), at the very end of your main function. That works for me like a charm...
If you are on linux, open the shortcuts:
Then type kill, this option will appear.
Double-click on the record, choose a shortcut for it, then open the terminal, ctrl + j, then press the shortcut you chose.
The difference in pressing ctrl+j
and then ctrl+j
again to close, is that it will not keep the terminal process, but only close it.
In certain cases, such as running a Node server, Ctrl-C wouldn't work. Instead, you can stop the app or command by pressing Ctrl+Alt+M (i.e. Ctrl+Option+M for mac users).
Sample JavaScript code to demonstrate this:
const http = require('http');
http.createServer((req, res) => {
res.write('Hello, world!');
res.end();
}).listen(5000, () => console.log('Server running...'));
In VSCode first hit following
ctrl + c
It will ask following question;
Terminate batch job (Y/N)?
Press Y + Enter
After this run following command on the prompt;
D:\Testing>exit + Enter
It will stop the instance.