Repository navigation
TMUX eats SIXEL DCS header #1388
Description
Activity
- Are you escaping (doubling) \033 inside the passthrough DCS sequence?…On Sat, 30 Jun 2018, 05:45 pagerc, ***@***.***> wrote: Platform: Windows 10 Pro 1803 Windows Subsystem for Linux Ubuntu 18.04 LTS (Bionic Beaver) Terminal: WSLtty - https://github.com/mintty/wsltty Display Resolution 3840x2160 WSLtty terminal size 80x24 Font Pixels 13x24 Outside tmux: echo $TERM putty-256color Inside tmux: uname -sp && tmux -V && echo $TERM Linux x86_64 tmux 2.6 screen Empty ~/.tmux.conf __dcs () { printf "\u1bP$1" ; } case "${TERM}" in screen*|tmux*) __tmux_guard() { __dcs "tmux;" ; sed 's:\x1b:\x1b\x1b:g' ; __st; };; *) alias __tmux_guard="cat";; esac GNUTERM="sixelgd size 600 400" \gnuplot -e "plot sin(x)" | __tmux_guard SIXEL graphics rendered by parent terminal [image: image] <https://user-images.githubusercontent.com/1564837/42121516-697438c6-7bfe-11e8-9750-a4d917168974.png> GNUTERM="sixelgd size 700 400" \gnuplot -e "plot sin(x)" | __tmux_guard SIXEL text strings to terminal [image: image] <https://user-images.githubusercontent.com/1564837/42121527-8918386c-7bfe-11e8-89a7-5585ce235660.png> — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1388>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AASkc0LLKy_zZiRWMucxGXJCOFEXC98wks5uBwJMgaJpZM4U91yZ> .
Yes, that's what __tmux_guard does, it sends the DCS P tmux; followed by SIXEL DCS followed by ST. I got the wrapper code and modified it from iTerm2's imgcat.
__tmux_guard() { __dcs "tmux;" ; sed 's:\x1b:\x1b\x1b:g' ; __st; };;rcpage@DESKTOP:
$ GNUTERM="sixelgd size 800,400" \gnuplot -e "plot sin(x)" | __tmux_guard | hexdump | head$ GNUTERM="sixelgd size 800,400" \gnuplot -e "plot sin(x)" | _tmux_guard | hexdump | tail
00000000 1b 50 74 6d 75 78 3b 1b 1b 50 71 22 31 3b 31 3b |.Ptmux;..Pq"1;1;|
00000010 38 30 30 3b 34 30 30 0a 23 32 35 3b 32 3b 32 3b |800;400.#25;2;2;|
00000020 31 3b 32 23 38 35 3b 32 3b 35 32 3b 35 31 3b 35 |1;2#85;2;52;51;5|
00000030 32 23 33 35 3b 32 3b 34 32 3b 31 3b 35 38 23 39 |2#35;2;42;1;58#9|
00000040 30 3b 32 3b 32 30 3b 32 31 3b 32 30 23 31 31 39 |0;2;20;21;20#119|
00000050 3b 32 3b 32 34 3b 31 3b 33 30 0a 23 38 34 3b 32 |;2;24;1;30.#84;2|
00000060 3b 37 37 3b 37 36 3b 37 37 23 31 30 34 3b 32 3b |;77;76;77#104;2;|
00000070 34 35 3b 32 36 3b 35 32 23 38 36 3b 32 3b 31 31 |45;26;52#86;2;11|
00000080 3b 31 32 3b 31 31 23 37 31 3b 32 3b 31 34 3b 31 |;12;11#71;2;14;1|
00000090 3b 31 37 23 31 30 35 3b 32 3b 35 32 3b 31 33 3b |;17#105;2;52;13;|
rcpage@DESKTOP:
00008120 35 35 21 31 37 35 3f 43 3f 3f 3f 41 24 0a 23 35 |55!175?C???A$.#5|
00008130 37 21 36 38 3f 67 23 33 38 5f 23 34 39 3f 3f 47 |7!68?g#38#49??G|
00008140 23 34 32 21 31 37 31 3f 5f 23 35 32 21 31 37 30 |#42!171?#52!170|
00008150 3f 40 23 34 39 3f 3f 3f 47 23 35 33 21 31 37 35 |?@#49???G#53!175|
00008160 3f 4f 23 35 37 21 31 37 35 3f 67 23 33 38 5f 23 |?O#57!175?g#38#|
00008170 34 39 3f 3f 47 24 0a 23 35 32 21 36 38 3f 40 23 |49??G$.#52!68?@#|
00008180 35 33 21 31 37 35 3f 4f 23 35 32 21 35 32 36 3f |53!175?O#52!526?|
00008190 40 2d 0a 23 32 35 21 38 30 30 7e 2d 0a 21 38 30 |@-.#25!800~-.!80|
000081a0 30 7e 2d 0a 21 38 30 30 4e 2d 0a 1b 1b 5c 1b 5c |0~-.!800N-....|
000081b0- Please attach two files one with what you are sending and one with what you expect tmux to send to the terminal. Also please show me the tmux server log from reproducing.…On Sat, 30 Jun 2018, 06:32 pagerc, ***@***.***> wrote: Yes, that's what __tmux_guard does, it sends the DCS P tmux; followed by SIXEL DCS followed by ST. I got the wrapper code and modified it from iTerm2's imgcat. __tmux_guard() { __dcs "tmux;" ; sed 's:\x1b:\x1b\x1b:g' ; __st; };; ***@***.***:$ GNUTERM="sixelgd size 800,400" \gnuplot -e "plot sin(x)" | __tmux_guard | hexdump | head 00000000 1b 50 74 6d 75 78 3b 1b 1b 50 71 22 31 3b 31 3b |.Ptmux;..Pq"1;1;| 00000010 38 30 30 3b 34 30 30 0a 23 32 35 3b 32 3b 32 3b |800;400.#25 <#25>;2;2;| 00000020 31 3b 32 23 38 35 3b 32 3b 35 32 3b 35 31 3b 35 |1;2#85;2;52;51;5| 00000030 32 23 33 35 3b 32 3b 34 32 3b 31 3b 35 38 23 39 |2#35;2;42;1;58#9| 00000040 30 3b 32 3b 32 30 3b 32 31 3b 32 30 23 31 31 39 |0;2;20;21;20#119| 00000050 3b 32 3b 32 34 3b 31 3b 33 30 0a 23 38 34 3b 32 |;2;24;1;30.#84 <#84>;2| 00000060 3b 37 37 3b 37 36 3b 37 37 23 31 30 34 3b 32 3b |;77;76;77#104;2;| 00000070 34 35 3b 32 36 3b 35 32 23 38 36 3b 32 3b 31 31 |45;26;52#86;2;11| 00000080 3b 31 32 3b 31 31 23 37 31 3b 32 3b 31 34 3b 31 |;12;11#71;2;14;1| 00000090 3b 31 37 23 31 30 35 3b 32 3b 35 32 3b 31 33 3b |;17#105;2;52;13;| ***@***.***:$ GNUTERM="sixelgd size 800,400" \gnuplot -e "plot sin(x)" | _ *tmux_guard | hexdump | tail 00008120 35 35 21 31 37 35 3f 43 3f 3f 3f 41 24 0a 23 35 |55!175?C???A$.#5 <#5>| 00008130 37 21 36 38 3f 67 23 33 38 5f 23 34 39 3f 3f 47 |7!68?g#38*#49 <#49>??G| 00008140 23 34 32 21 31 37 31 3f 5f 23 35 32 21 31 37 30 |#42 <#42>!171? *#52 <#52>!170| 00008150 3f 40 23 34 39 3f 3f 3f 47 23 35 33 21 31 37 35 |?@#49 <#49>???G#53!175| 00008160 3f 4f 23 35 37 21 31 37 35 3f 67 23 33 38 5f 23 |?O#57!175?g#38*#| 00008170 34 39 3f 3f 47 24 0a 23 35 32 21 36 38 3f 40 23 |49??G$.#52 <#52>!68?@#| 00008180 35 33 21 31 37 35 3f 4f 23 35 32 21 35 32 36 3f |53!175?O#52!526?| 00008190 40 2d 0a 23 32 35 21 38 30 30 7e 2d 0a 21 38 30 ***@***.***#25 <#25>!800~-.!80| 000081a0 30 7e 2d 0a 21 38 30 30 4e 2d 0a 1b 1b 5c 1b 5c |0~-.!800N-....| 000081b0 — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1388 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AASkc-mJ5X7A-hcELWbaSarhG39vwgfXks5uBw2HgaJpZM4U91yZ> .
I was testing my plots, and when I run the plot from gnuplot, it sometimes renders and sometimes fails. I piped it to a file and to sha1sum, and I'm constantly getting the same sha1sum. However, when I cat the file that I piped the pixel plot with tmux DCS wrapper, that renders every time I cat the file. Could there be a buffering issue with the amount of data going through my shell script/sed?
tmux-client-1550.log
tmux-out-1552.log
tmux-server-1552.log
plot.sixel.tmux.gz- Is this a server log from when it fails?…On Sat, 30 Jun 2018, 06:46 pagerc, ***@***.***> wrote: I was testing my plots, and when I run the plot from gnuplot, it sometimes renders and sometimes fails. I piped it to a file and to sha1sum, and I'm constantly getting the same sha1sum. However, when I cat the file that I piped the pixel plot with tmux DCS wrapper, that renders every time I cat the file. Could there be a buffering issue with the amount of data going through my shell script/sed? tmux-client-1550.log <https://github.com/tmux/tmux/files/2151461/tmux-client-1550.log> tmux-out-1552.log <https://github.com/tmux/tmux/files/2151462/tmux-out-1552.log> tmux-server-1552.log <https://github.com/tmux/tmux/files/2151463/tmux-server-1552.log> plot.sixel.tmux.gz <https://github.com/tmux/tmux/files/2151464/plot.sixel.tmux.gz> — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1388 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AASkc45B6nTopA9LGW_LteIHCGTMwzU5ks5uBxDRgaJpZM4U91yZ> .
- Oh it is probably too slow so tmux is aborting the DCS. You can try bumping the timeout in input_start_timer. On Sat, 30 Jun 2018, 06:52 Nicholas Marriott, <[email protected]> wrote:…Is this a server log from when it fails? On Sat, 30 Jun 2018, 06:46 pagerc, ***@***.***> wrote: > I was testing my plots, and when I run the plot from gnuplot, it > sometimes renders and sometimes fails. I piped it to a file and to sha1sum, > and I'm constantly getting the same sha1sum. However, when I cat the file > that I piped the pixel plot with tmux DCS wrapper, that renders every time > I cat the file. Could there be a buffering issue with the amount of data > going through my shell script/sed? > tmux-client-1550.log > <https://github.com/tmux/tmux/files/2151461/tmux-client-1550.log> > tmux-out-1552.log > <https://github.com/tmux/tmux/files/2151462/tmux-out-1552.log> > tmux-server-1552.log > <https://github.com/tmux/tmux/files/2151463/tmux-server-1552.log> > plot.sixel.tmux.gz > <https://github.com/tmux/tmux/files/2151464/plot.sixel.tmux.gz> > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <#1388 (comment)>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AASkc45B6nTopA9LGW_LteIHCGTMwzU5ks5uBxDRgaJpZM4U91yZ> > . >
Yes, I ran gnuplot and it spat text to the screen, and I cat the plot.sixel.tmux file to render the image too. cat'ing the file seems to work reliably to render, running gnuplot in pipeline does not.
I've gotten the gnuplot to render sometimes and do text garbage the next invocation, back to back just up-arrow/enter and I get different terminal behavior from tmux.
I'm leaning towards some latency in gnuplot generating/piping data through sed vs cat'ing the image from disk to screen makes a difference in control sequence processing.Is that a recompile to adjust the hardcoded timer, or can it be overwritten in a config?
https://github.com/tmux/tmux/blob/master/input.cI put a sleep 0.2 in my __tmux_guard before the DCS P tmux;, and I'm seeing the rendering be more reliable. Thanks for the assistance!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
- locked and limited conversation to collaborators
on Feb 15, 2020
Platform:
Windows 10 Pro 1803 Windows Subsystem for Linux Ubuntu 18.04 LTS (Bionic Beaver)
Terminal:
WSLtty - https://github.com/mintty/wsltty
Display Resolution 3840x2160
WSLtty terminal size 80x24
Font Pixels 13x24
Outside tmux:
echo $TERM
putty-256color
Inside tmux:
uname -sp && tmux -V && echo $TERM
Linux x86_64
tmux 2.6
screen
Empty ~/.tmux.conf
__dcs () { printf "\u1bP$1" ; }
__st() { printf "\u1b\" ; }
case "${TERM}" in
screen*|tmux*) __tmux_guard() { __dcs "tmux;" ; sed 's:\x1b:\x1b\x1b:g' ; __st; };;
*) alias __tmux_guard="cat";;
esac
GNUTERM="sixelgd size 600 400" \gnuplot -e "plot sin(x)" | __tmux_guard

SIXEL graphics rendered by parent terminal
GNUTERM="sixelgd size 700 400" \gnuplot -e "plot sin(x)" | __tmux_guard

SIXEL text strings to terminal