how to stop a command in the VS Code terminal

后端 未结 11 1018
天命终不由人
天命终不由人 2021-02-06 22:48

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

11条回答
  •  离开以前
    2021-02-06 23:55

    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...'));
    

提交回复
热议问题