2

I have a vagrant in which one I launch a node server on start. The node server is started in a tmux session but when I attach my tmux session and I do a ctrl + c the server is killed but the tmux session is exited.

For example:

tmux       #start a new session and go to tmux
npm start  #start my node server
(ctrl + c) #exit my tmux session 

Is there a way to stop my server without exiting my tmux session ?

2
  • Have you tried npm stop? Jan 27, 2015 at 23:44
  • nop, the server is launch and I have no access to the terminal, a little like if you did a tail -f
    – Ajouve
    Jan 28, 2015 at 8:38

1 Answer 1

0

There are a couple possible approaches here.

You could try using set-options as follows:

tmux set-option remain-on-exit on

This will keep your tmux session alive even after the process exists. Alternatively, you could just add on a & bash to the end of your npm start as in npm start & bash.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .