You are not logged in.
Hello, I find it convenient launching apps from terminal, but after that I am unable to use the terminal, since it it's "attached" to the process. Some searching revealed 2 methods of doing this, but they both don't work for me
1) add "&" after the command: upon closing the terminal the application closes as well; not what I want
2) press ctrl+z: this just closes the app
So how do I type a command to launch a GUI app and continue using the terminal?
I am using mate-terminal.
Last edited by axper (2013-02-11 19:14:08)
Offline
just a small point, but ctrl-z doesn't close the app, it suspends it. You can background it with 'bg' but it's the same (I think) as just launching it with an & to begin with
Offline
'nohup' command from coreutils might be what you are looking for. Or in case of zsh, doing it like this:
guiapp &|
There was a thread about this recently, there were more ways to do it.
Last edited by kaszak696 (2013-02-11 18:15:53)
'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard
Offline
Thanks for answers.
"nohup appname &" worked.. kinda, but it creates "nohup.out" file in my home dir, which is kinda messy
Also some programs close when terminal is closed, like pcmanfm
nohup pcmanfm &
And I can't use tab-completion, which isn't good
"guiapp &|" didn't work, since I use bash (I think?)
Offline
'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard
Offline
Thanks a lot, this is exactly what I wanted (for Bash):
You can disown them (man bash). I have put
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'disown -a -h'
in my ~/.bashrc with the effect that if you launch a program in the background (with &). It will not be stopped when you close the terminal.
For Zsh, put this in your .zshrc
precmd_disown() {
emulate -L zsh
setopt extendedglob
local job match mbegin mend
jobs | while read job; do
if [[ $job = \[(#b)([[:digit:]]##)\]*running* ]]; then
disown %$match[1]
fi
done
}
autoload -U add-zsh-hook
add-zsh-hook precmd precmd_disown
(from http://www.zsh.org/mla/users/2010/msg00654.html)
Last edited by axper (2013-06-29 07:47:21)
Offline