What is the terminal command other than ctrl + c to exit a running Node.js program in a macOS?

66,587

Solution 1

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.

Solution 2

Try:

Ctrl + C

It should be the same as Linux.

Duplicate of: this question

Solution 3

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.

Solution 4

Try Shift + Command + C worked for a friend.

Solution 5

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.

Share:
66,587

Related videos on Youtube

Sagi_Avinash_Varma
Author by

Sagi_Avinash_Varma

Updated on September 18, 2022

Comments

  • Sagi_Avinash_Varma
    Sagi_Avinash_Varma over 1 year

    In Linux terminal if I run a command like:

    $ node httserver.js
    

    The 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.

  • Brian D
    Brian D over 3 years
    confirmed, other answers seem to be confused. Command+. works in OS X (Mac) Terminal application for sending an interrupt with a Mac keyboard. Control+C, Control+Z, Shift+Command+C, kill commands do not work in this setting. you cannot send a kill command while another command is actively running.
  • Admin
    Admin almost 2 years
    ctrl-z does NOT do this. And "Or you can use the kill command" does not make any sense. Ctrl-Z and kill are completely and utterly different. I dont think you know what Ctrl-z does