summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/fm.py6
-rw-r--r--ranger/core/runner.py3
2 files changed, 9 insertions, 0 deletions
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 93ac793b..59eb4e18 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -174,6 +174,7 @@ class FM(Actions, SignalDispatcher):
 		loader = self.loader
 		env = self.env
 		has_throbber = hasattr(ui, 'throbber')
+		zombies = self.run.zombies
 
 		try:
 			while True:
@@ -190,6 +191,11 @@ class FM(Actions, SignalDispatcher):
 
 				ui.handle_input()
 
+				if zombies:
+					for zombie in tuple(zombies):
+						if zombie.poll() is not None:
+							zombies.remove(zombie)
+
 				gc_tick += 1
 				if gc_tick > TICKS_BEFORE_COLLECTING_GARBAGE:
 					gc_tick = 0
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index 2773d2bd..940f410e 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -98,6 +98,7 @@ class Runner(object):
 		self.ui = ui
 		self.logfunc = logfunc
 		self.apps = apps
+		self.zombies = set()
 
 	def _log(self, text):
 		try:
@@ -201,6 +202,8 @@ class Runner(object):
 			else:
 				if context.wait:
 					process.wait()
+				else:
+					self.zombies.add(process)
 				if wait_for_enter:
 					press_enter()
 		finally: