mirror of
https://github.com/tmux/tmux.git
synced 2026-10-15 16:04:34 +00:00
Ignore stray characters in SIXEL data instead of discarding the image. Regression test included.
This commit is contained in:
@@ -482,10 +482,8 @@ sixel_parse(const char *buf, size_t len, u_int p1, u_int p2, u_int cell_w,
|
||||
si->dx = 0;
|
||||
break;
|
||||
default:
|
||||
if (ch < 0x20)
|
||||
break;
|
||||
if (ch < 0x3f || ch > 0x7e)
|
||||
goto bad;
|
||||
break;
|
||||
if (sixel_parse_write(si, ch - 0x3f) != 0) {
|
||||
log_debug("%s: width limit reached", __func__);
|
||||
goto bad;
|
||||
|
||||
@@ -68,6 +68,14 @@ $TMUX new-window -d "
|
||||
sleep 1
|
||||
[ "$($TMUX capture-pane -pt:1 -S0 -E0)" = "XY" ] || exit 1
|
||||
|
||||
# Stray characters in SIXEL data are ignored, not fatal to the whole image.
|
||||
$TMUX new-window -d -n sixel-stray "
|
||||
printf '\033Pq#0;2;100;0;0#0!8~ \$!8~-!8~\033\\\\'
|
||||
sleep 10"
|
||||
sleep 1
|
||||
[ "$($TMUX display-message -pt:sixel-stray '#{cursor_y}')" -gt 0 ] || exit 1
|
||||
$TMUX kill-window -t:sixel-stray || 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 "
|
||||
|
||||
Reference in New Issue
Block a user