diff options
-rw-r--r-- | ranger/defaults/rifle.conf | 2 | ||||
-rwxr-xr-x | 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): |