Image regress tests.

This commit is contained in:
Nicholas Marriott
2026-10-14 12:44:53 +01:00
parent 1e294b175f
commit 1de5f662cb
29 changed files with 2014 additions and 13 deletions

View File

@@ -0,0 +1,41 @@
#!/bin/sh
# Moving a copy-mode selection cursor must not retransmit unchanged images.
. ./image-noflash-common.inc
# The image, at the top of the pane, followed by enough plain lines that the
# cursor can move down through it and past it without the view needing to
# scroll.
$TMUX new-session -d -s inner -x 40 -y 20 \
"printf '$SIXEL_HEADER'; for i in \$(seq 1 15); do echo line\$i; done; exec sh" ||
exit 1
sleep 0.5
image_check_support $TMUX
$TMUX set -as terminal-features ',*:sixel' || exit 1
start_capture 40 20
assert_image_reached
: >$TMP
# Enter copy-mode, scroll to the top (where the image is) and select down
# through it one cursor step at a time - the view does not need to scroll
# for any of this, since the image is already at the top of what is
# visible.
$TMUX copy-mode -t inner || fail "copy-mode failed"
$TMUX send-keys -X history-top || fail "history-top failed"
sleep 0.2
: >$TMP
$TMUX send-keys -X begin-selection || fail "begin-selection failed"
i=0
while [ $i -lt 6 ]; do
$TMUX send-keys -X cursor-down || fail "cursor-down failed"
sleep 0.15
i=$((i + 1))
done
sleep 0.5
assert_no_retransmit "while just moving the selection cursor"
exit 0