scratch-text-editor in terminal, but now I want to close the terminal without closing scratch.
Is this possible, if so; how?
You can use:
nohup scratch-text-editor /path/to/file &
Then close terminal with
If you want direct in single command: Use
exit at the end of the command. like,
nohup scratch-text-editor /path/to/file & exit
setsid scratch-text-editor /path/to/file ; exit
scratch-text-editor /path/to/file & disown ; exit
All in one command:
(scratch-text-editor /path/to/file &) ; exit
In the future use this command:
scratch-text-editor /file/to/open.txt &
& on the end there. That will start it as a separate process.
Now to close the terminal, simply hit Ctrl + D.
If you forget to use
& then you can detach it. First press Ctrl + Z to suspend the program. This can crash some, but it is unlikely.
bg to send it to background, and then press Ctrl + D as above.
As a side note, instead of
bg you can use
%. This simply brings it back into the terminal.
Simply detach the process from terminal's process to its parent by:
command-to-run & disown
This should work with any app opened from the terminal.
After Scratch opens, type:
Ctrl + z
This will halt the process, but not close Scratch.
This will move Scratch's process to the background.
Now, finally type: