From a575c01b5cba723418cf8733a640751e98bca5a9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 23 Mar 2017 08:03:43 +1100 Subject: [PATCH] iTerm2: Fix image mode in tmux, closes #678 --- neofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 8f24e1d0..97289078 100755 --- a/neofetch +++ b/neofetch @@ -2416,7 +2416,12 @@ display_image() { ;; "iterm2") - printf "%b\a\n" "\033]1337;File=width=${width}px;height=${height}px;inline=1:$(base64 < "$image")" + iterm_cmd="\033]1337;File=width=${width}px;height=${height}px;inline=1:$(base64 < "$image")" + + # Tmux requires an additional escape sequence for this to work. + [[ -n "$TMUX" ]] && iterm_cmd="\033Ptmux;\033${iterm_cmd}\033\\" + + printf "%b\a\n" "$iterm_cmd" ;; "tycat")