summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-10-12 04:07:21 +0200
committerhut <hut@lavabit.com>2010-10-12 04:07:21 +0200
commitdcd610f7b768b75f57017c0a037b99540e5cb061 (patch)
tree442a223a7841a80a5063bcffe1cfee0a0ab9f093
parentf6e84977da884b54c1ad16d55dbdf1fa6485f252 (diff)
downloadranger-dcd610f7b768b75f57017c0a037b99540e5cb061.tar.gz
core.loader: make sure to read everything from stdout/err
-rw-r--r--ranger/core/actions.py1
-rw-r--r--ranger/core/loader.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 50c322c4..6fd9ad09 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -600,7 +600,6 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 				def on_after(signal):
 					exit = signal.process.poll()
 					content = signal.loader.stdout_buffer
-					content += signal.process.stdout.read()
 					data['foundpreview'] = True
 					if exit == 0:
 						data[(width, height)] = content
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 85033881..02e8c232 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -94,6 +94,11 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware):
 								self.stdout_buffer += read
 				except select.error:
 					sleep(0.03)
+			if not self.silent:
+				for l in process.stderr.readlines():
+					self.fm.notify(l, bad=True)
+			if self.read:
+				self.stdout_buffer += process.stdout.read()
 		self.finished = True
 		self.signal_emit('after', process=process, loader=self)