From ea8c70ca98149a5d98043b84659d7bca77f984ca Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 19 Mar 2012 22:45:15 +0100 Subject: ext.rifle: use setsid instead of nohup (keep nohup as fallback) this could perhaps be done by os.setsid and os.fork etc --- ranger/defaults/rifle.conf | 2 +- ranger/ext/rifle.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ranger/defaults/rifle.conf b/ranger/defaults/rifle.conf index 2e86d463..2f99adba 100644 --- a/ranger/defaults/rifle.conf +++ b/ranger/defaults/rifle.conf @@ -30,7 +30,7 @@ # # Flags are single characters which slightly transform the command: # f | Fork the program, make it run in the background. -# | New command = nohup $command >& /dev/null & +# | New command = setsid $command >& /dev/null & # r | Execute the command with root permissions # | New command = sudo $command # t | Run the program in a new terminal. If $TERMCMD is not defined, diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index 80dd0ba7..b98c35d3 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -189,7 +189,10 @@ class Rifle(object): os.environ['TERMCMD'] = term action = "$TERMCMD -e %s" % action if 'f' in flags: - action = "nohup %s >& /dev/null &" % action + if 'setsid' in get_executables(): + action = "setsid %s >& /dev/null &" % action + else: + action = "nohup %s >& /dev/null &" % action return action def list_commands(self, files, mimetype=None): -- cgit 1.4.1-2-gfad0