summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2018-05-31 09:27:06 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2018-05-31 09:27:06 +0200
commit3cef02888ddbb677dec96f1688ad7d5e7db37c56 (patch)
treeb68786259ad6a03c517b1fb086afcb84391b6ffd
parentdd3226e3df4e7a185fd11586144dce7ca7eca05b (diff)
downloadranger-3cef02888ddbb677dec96f1688ad7d5e7db37c56.tar.gz
Mitigate the issue with black horizontal bars
Fixes #1192.
-rw-r--r--ranger/ext/img_display.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index 78d71cb2..f423830f 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -119,6 +119,13 @@ class W3MImageDisplayer(ImageDisplayer):
             input_gen = self._generate_w3m_input(path, start_x, start_y, width, height)
         except ImageDisplayError:
             raise
+
+        # Mitigate the issue with the horizontal black bars when
+        # selecting some images on some systems. 2 milliseconds seems
+        # enough. Adjust as necessary.
+        from time import sleep
+        sleep(0.02)
+
         self.process.stdin.write(input_gen)
         self.process.stdin.flush()
         self.process.stdout.readline()