about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorCullen Ross <cullenrss@gmail.com>2021-06-04 17:13:56 -0400
committerCullen Ross <cullenrss@gmail.com>2021-06-04 18:09:02 -0400
commit4895901e30af675af229bf630b73527d3aac99f2 (patch)
tree1730abe2c2708b756be94f2f5b0fcd11122e532c /ranger
parent5d1452376e38cc9175c3576161c351768bd86f54 (diff)
downloadranger-4895901e30af675af229bf630b73527d3aac99f2.tar.gz
Fix tmux image display for other possible TERMs
Check substrings

Properly check substrings
Diffstat (limited to 'ranger')
-rw-r--r--ranger/ext/img_display.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index b738f458..6cb6a815 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -298,7 +298,7 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware):
         content = self._encode_image_content(path)
         display_protocol = "\033"
         close_protocol = "\a"
-        if "screen" in os.environ['TERM']:
+        if os.environ["TERM"].startswith(("screen", "tmux")):
             display_protocol += "Ptmux;\033\033"
             close_protocol += "\033\\"
 
@@ -430,7 +430,7 @@ class URXVTImageDisplayer(ImageDisplayer, FileManagerAware):
     def __init__(self):
         self.display_protocol = "\033"
         self.close_protocol = "\a"
-        if "screen" in os.environ['TERM']:
+        if os.environ["TERM"].startswith(("screen", "tmux")):
             self.display_protocol += "Ptmux;\033\033"
             self.close_protocol += "\033\\"
         self.display_protocol += "]20;"