Code: Select all
# geany &
There are simple ways to overcome the problem, using built-in commands.
1) disown
It signals that it want to be free, not owned by another process! It is a bash command that removes the program from the terminal shell's table of active jobs. Now you can close the terminal window, and the command/application/program keep running.
2) nohup
This coreutils command let you bypass the Hang Up signal, which is sent when the terminal window closes. (stoneage analog telephone handset modem lingo). As you see in the copies of terminal windows below, it is still running as a job under the shell in the terminal window, but will stay open when the terminal shell send the SIGHUP signal to it's jobs.
Sometime, a program which is background with &, can print a message to the terminal window, which you just have started using for other commands, very annoying! A program backgrounded with nohup, can maybe write a message to a nohup.out file that it creates. Both these cases can also easily be avoided, by redirecting output to /dev/null, which is a bottomless hole.
Code: Select all
# geany &>/dev/null &
Code: Select all
#nohup geany &</dev/null &
My urxvt terminal window in Dpup Stretch-7.5 has tabs, so I can just open a new tab for other commands, and then close each tab separately with Ctrl-D. When only one tab is left, Ctrl-D closes urxvt. The funny thing is, that when I run for example
Code: Select all
geany &
I need input from some expert who can explain that one...
If you run hTop while performing some tests, set Display options to Tree view to see where your program is located.