summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorM Rawash <mrawash@gmail.com>2011-12-19 08:44:46 +0200
committerM Rawash <mrawash@gmail.com>2011-12-19 08:44:46 +0200
commitfc17126a6a0ab436c757c545fa55e87ccd89635c (patch)
tree921fa891fa002c840d367e90f0f7693e05c42ea3
parentfcc47bf5261f328fb38c2df03f62c0847e562552 (diff)
downloadranger-fc17126a6a0ab436c757c545fa55e87ccd89635c.tar.gz
core/runner.py: allow combination of 'r' and 'd' flags
-rw-r--r--ranger/core/runner.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index 7d433652..baec1595 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -194,10 +194,11 @@ class Runner(object):
 		if 'r' in context.flags:
 			if 'sudo' not in get_executables():
 				return self._log("Can not run with 'r' flag, sudo is not installed!")
+			dflag = ('d' in context.flags)
 			if isinstance(action, str):
-				action = 'sudo '+action
+				action = 'sudo ' + (dflag and '-b ' or '') + action
 			else:
-				action = ['sudo']+action
+				action = ['sudo'] + (dflag and ['-b'] or []) + action
 			toggle_ui = True
 			context.wait = True
 		if 't' in context.flags: