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.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/applications.py b/ranger/applications.py
index d71170c7..4c329a05 100644
--- a/ranger/applications.py
+++ b/ranger/applications.py
@@ -68,10 +68,14 @@ def run(*args, **kw):
 		return process
 
 	else:
-		if fm.ui: fm.ui.suspend()
-		p = Popen(args, **popen_kw)
-		waitpid_no_intr(p.pid)
-		if fm.ui: fm.ui.initialize()
+		if fm.ui:
+			fm.ui.suspend()
+		try:
+			p = Popen(args, **popen_kw)
+			waitpid_no_intr(p.pid)
+		finally:
+			if fm.ui:
+				fm.ui.initialize()
 		return p
 
 def spawn(command, fm=None, suspend=True, wait=True):
' href='#n121'>121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158