Discussion:
[iterm2-discuss] imgcat and tmux may not play nice if output is delayed
Raymond Page
2018-06-30 06:14:31 UTC
Permalink
Just wanted to share that anyone using iTerm2 and tmux with unreliable
imgcat behavior, it could be due to the DCS timeout in the tmux code.
The workaround is to buffer the image output prior to sending DCS command
to tmux.

https://github.com/tmux/tmux/issues/1388

__dcs () { printf "\u1bP$1" ; }
__st() { printf "\u1b\" ; }
case "${TERM}" in
screen*|tmux*) __tmux_guard() { dd bs=1 count=1 2> /dev/null; __dcs
"tmux;\x1b\x1b" ; sed 's:\x1b:\x1b\x1b:g' ; __st; };;
*) alias __tmux_guard="cat";;
esac





print_image from line 28 of imgcat, could be modified so that it's used
like "print_image | __tmux_guard", __tmux_guard will wait for 1 byte of
data on stdin, assume that it's an escape sequence \033, \x1b, \u1b,
consume it, assume we've got buffered stdin and can trigger the DCS to tmux.
--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...