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. What is it?
You can terminate with the Trash icon like you do, or press Ctrl + C. That's the shortcut from the default Terminal application and it also works in Visual Studio Code.
In certain cases, such as running a Node.js 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...'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With