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)
 
='n175' href='#n175'>175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354