What is the terminal command other than ctrl + c to exit a running Node.js program in a macOS?
Sophia Terry
In Linux terminal if I run a command like:
$ node httserver.jsThe command runs and by doing ctrl + c the program is terminated and new line comes in terminal for us to enter a command.
I felt ctrl + c as the macOS terminal keyboard combo to do that but it doesn’t work.
16 Answers
The accurate answer for MAC Keyboard on terminal is:
Command + . (dot/period)
This is equivalent to Ctrl + C or break.
Refer to the:
Terminal Help > Keyboard Shortcuts > Other Shortcuts > Break
The Control or Ctrl key is not a regular modifier in macOS.
However, if you are using a regular Windows keyboard with macOS then Ctrl + C works since there is no Command key in this case.
1Try:
Ctrl + C
It should be the same as Linux.
Duplicate of: this question
Try Ctrl + Z
Or you can use kill Command. For further information see man kill command for manual of kill command and you can get some guidance from this link about how to use kill command.
Try Shift + Command + C worked for a friend.
If you are using iterm2, you might need to look into Preferences -> Keys -> Remap Modifiers. In my case, control (^) was mapped to something else by default. After mapping it to control (^), the shortcut worked.
Typing Ctrl + h took me to a help thing where it showed me the letter to type to exit.
In my case, it indicated I had to use Ctrl + q.