Saturday, May 18, 2024
32
rated 0 times [  32] [ 0]  / answers: 1 / hits: 40411  / 2 Years ago, sat, october 29, 2022, 3:13:24

I am new to Ubuntu. I have used Sublime Text. I have realized that after I open Sublime Text from the Terminal, if I close the terminal the application keeps running. The same isn't true for other applications like geany.



After I open the application from terminal, when I close the terminal the application also closes. I have tried &exit like geany &exit. But this isn't what I am looking for.



How can I keep geany running even after I close it?


More From » command-line

 Answers
3

EDIT: This may only work for certain types of terminals. It is best to run one more command of disown after starting your commands like below so the applications are disassociated with the terminal window.




From a terminal window, type in


nohup geany > /dev/null
disown

or


nohup geany >/dev/null &
disown

nohup allows the application to be ran and immune to hangups, so closing the terminal window would have no effect on the application being run. Adding the >/dev/null to the command prevents the creation of a nohup.out in each directory the application is being run from.


From the man page:


NAME
nohup - run a command immune to hangups, with output to a non-tty

SYNOPSIS
nohup COMMAND [ARG]...
nohup OPTION

And


$ disown --help
disown: disown [-h] [-ar] [jobspec ... | pid ...]
Remove jobs from current shell.

Removes each JOBSPEC argument from the table of active jobs. Without
any JOBSPECs, the shell uses its notion of the current job.

Options:
-a remove all jobs if JOBSPEC is not supplied
-h mark each JOBSPEC so that SIGHUP is not sent to the job if the
shell receives a SIGHUP
-r remove only running jobs

Exit Status:
Returns success unless an invalid option or JOBSPEC is given.

[#19049] Sunday, October 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionpromoti

Total Points: 14
Total Questions: 112
Total Answers: 113

Location: Tonga
Member since Tue, Nov 30, 2021
3 Years ago
;