Close terminal and avoid closing running program [duplicate]

You can close the terminal by pressing Ctrl-D at the prompt instead of using the window controls. This will do what you want.


One solution is to use screen and detach from it:

sudo apt-get install screen    
screen
<program name> &
ctrl-a ctrl-d (this detaches the screen session)

This is useful especially when starting programs on remote servers. You can then run screen -R to reattach. See this howto.