I'm on a Mac OS X 10.6.7.

I started a node.js script, which starts an HTTP server.

The problem is that I lost the command line, it looks like this:

$me cd directory
$me node test.js
Message from test.js: Server is running on localhost

| = indicates the caret

It's possible to write but I'm unable to run any code, it's like writing a plain string, how can I get back to the commmand line?

Sorry I'm really noob in terminal :)


Press Ctrl+C to terminate the program and get back to the shell prompt.

If you want a program to run in the background and return you to a shell prompt, append an ampersand (&) to the end of the command. For example:

node test.js &
  • If you want to keep it running press [ctrl] + [z] then type bg – Chris Nava Apr 7 '11 at 4:27
  • Thanks @ChrisNava I never knew that you could do bg and fg without using %1 (or %something). Great point! – Dan Rosenstark Oct 27 '11 at 5:37

Just open a new tab by pressing Cmd-T, or a new window (using Cmd-N). You want to get warning/error messages that program sends to your terminal.

You can also use screen to get multiple... er... terminals in a single tab/window.

Press Ctrl-A Ctrl-C to create a new terminal, Ctrl-A Ctrl-N or Ctrl-A Ctrl-P (repeatedly) to go to the next and previous terminals. Type exit in all screen terminals to leave.

Regarding node: Check the documentation -- it should be possible to start it as a background server.


Just type Q to get back to the command line, from the help module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.