From 4895901e30af675af229bf630b73527d3aac99f2 Mon Sep 17 00:00:00 2001 From: Cullen Ross Date: Fri, 4 Jun 2021 17:13:56 -0400 Subject: Fix tmux image display for other possible TERMs Check substrings Properly check substrings --- ranger/ext/img_display.py | 4 ++-- 1 file 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;" -- cgit 1.4.1-2-gfad0