summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorseebye <seebye@users.noreply.github.com>2018-10-25 16:34:02 +0200
committerseebye <seebye@users.noreply.github.com>2018-10-25 16:34:02 +0200
commit6351c6cb904b28275b7da3a7d8d7484032887bc1 (patch)
tree39b6e8aff80f4e44c227879a3ac0ff1a9b0dcf25
parentc67418c71dc7dc78ad20ae98775b8e320fd63e3d (diff)
downloadranger-6351c6cb904b28275b7da3a7d8d7484032887bc1.tar.gz
ueberzug: timeout: end process with SIGTERM, use SIGKILL as fallback
-rw-r--r--ranger/ext/img_display.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index cfb72639..4207b22e 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -721,10 +721,13 @@ class UeberzugImageDisplayer(ImageDisplayer):
     def quit(self):
         if (self.is_initialized and self.process.poll() is None and
                 not self.process.stdin.closed):
-            timer = threading.Timer(1, self.process.kill, [])
+            timer_term = threading.Timer(1, self.process.terminate, [])
+            timer_kill = threading.Timer(2, self.process.kill, [])
             self.process.stdin.close()
             try:
-                timer.start()
+                timer_term.start()
+                timer_kill.start()
                 self.process.communicate()
             finally:
-                timer.cancel()
+                timer_term.cancel()
+                timer_kill.cancel()