about summary refs log tree commit diff stats
path: root/ranger/applications.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/applications.py')
-rw-r--r--ranger/applications.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ranger/applications.py b/ranger/applications.py
index ed5f282e..ae1ca2e1 100644
--- a/ranger/applications.py
+++ b/ranger/applications.py
@@ -81,10 +81,15 @@ def spawn(command, fm=None, suspend=True, wait=True):
 		fm.ui.suspend()
 
 	try:
-		if fm and fm.stderr_to_out:
-			process = Popen(command, shell=True, stderr=STDOUT)
+		if wait:
+			kw = {}
 		else:
-			process = Popen(command, shell=True)
+			kw = {'stdout':null, 'stderr':null, 'stdin':null}
+
+		if fm and fm.stderr_to_out:
+			if 'stderr' not in kw:
+				kw['stderr'] = STDOUT
+		process = Popen(command, shell=True, **kw)
 		if wait:
 			waitpid_no_intr(process.pid)
 	finally: