End a SIXEL string at an Escape that is not followed by a backslash.

An unterminated SIXEL image kept the pane in the DCS state, so everything
the program printed afterwards was swallowed until the timeout, and the image
itself was never drawn. Treat the Escape as the end of the image, as other
terminals do, and handle the sequence after it normally. Other DCS strings
are unchanged.
This commit is contained in:
Michael Grant
2026-10-14 15:28:52 +02:00
parent 8856c1e669
commit 7b45ee638b
2 changed files with 35 additions and 2 deletions

View File

@@ -76,6 +76,15 @@ sleep 1
[ "$($TMUX display-message -pt:sixel-stray '#{cursor_y}')" -gt 0 ] || exit 1
$TMUX kill-window -t:sixel-stray || exit 1
# A SIXEL string that is not terminated ends at the next Escape, and the
# sequence after it is still processed.
$TMUX new-window -d -n sixel-esc "
printf '\033Pq#0;2;100;0;0#0!8~\033[HXY'
sleep 10"
sleep 1
[ "$($TMUX capture-pane -pt:sixel-esc -S0 -E0)" = "XY" ] || exit 1
$TMUX kill-window -t:sixel-esc || exit 1
# The protocol default is transmit-only; a later placement uses the retained
# immutable image and advances by the same canonical one-cell footprint.
$TMUX new-window -d "