mirror of
https://github.com/tmux/tmux.git
synced 2026-10-13 22:34:23 +00:00
regress: rationalise image test coverage, add missing image_support guard
- Extract shared setup for the "noflash" retransmission-avoidance tests
(image-movepane-drag-noflash.sh, image-splitwindow-resize-noflash.sh,
image-status-pane-click-noflash.sh, image-selection-noflash.sh) into
a new image-noflash-common.inc, matching the existing input-common.inc
convention: dual-server cleanup/fail helpers, the shared SIXEL fixture,
the attach-and-capture sequence, and the final DCS-retransmission
assertion. Each test keeps its own distinct interaction and failure
message; only the copy-pasted scaffolding moved.
- Add the missing #{image_support} runtime guard to
image-border-status-sixel.sh, which cats a real SIXEL fixture and
specifically guards a sixel-after-pane-creation ordering bug - without
it, the DCS sequence is compiled out entirely on a non-image build and
the test's assertions could pass without exercising anything.
image-border-status-wipe.sh is deliberately left unguarded: it has no
image/sixel content at all and guards a general border-status caching
bug unrelated to ENABLE_IMAGES.
- Reviewed the rest of the branch's regress/image-*.sh tests in full
(not just headers) for redundant coverage; none warranted merging -
each guards a genuinely distinct fix via a distinct mechanism.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
80
regress/image-border-status-sixel.sh
Executable file
80
regress/image-border-status-sixel.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
|
||||
# A SIXEL emitted immediately after creating a floating pane must not erase
|
||||
# pane-border-status text. Exercise the same queued new; newp; send-keys path
|
||||
# used by the reported reproduction, then repeat it with two tiled panes.
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
LC_ALL=C.UTF-8
|
||||
export TERM LC_ALL
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||
TMUX="$TEST_TMUX -Libss$$ -f/dev/null"
|
||||
TMUX2="$TEST_TMUX -Libss-outer$$ -f/dev/null"
|
||||
FIXTURE=$(pwd)/monkey-2.sixel.txt
|
||||
|
||||
cleanup()
|
||||
{
|
||||
$TMUX kill-server >/dev/null 2>&1
|
||||
$TMUX2 kill-server >/dev/null 2>&1
|
||||
}
|
||||
fail()
|
||||
{
|
||||
echo "$*" >&2
|
||||
cleanup
|
||||
exit 1
|
||||
}
|
||||
expect_title()
|
||||
{
|
||||
if ! grep -q "$1" "$TMP"; then
|
||||
missing_titles="$missing_titles $2"
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup
|
||||
TMP=$(mktemp)
|
||||
missing_titles=
|
||||
trap "cleanup; rm -f $TMP" 0 1 15
|
||||
|
||||
$TMUX new-session -d -s inner -x 100 -y 30 sh || fail "new session failed"
|
||||
[ "$($TMUX display-message -p '#{image_support}')" = 0 ] && exit 0
|
||||
$TMUX set -g status off
|
||||
$TMUX set -g pane-border-status top
|
||||
$TMUX set -g pane-border-format '#{pane_title}'
|
||||
$TMUX set -as terminal-features ',*:sixel'
|
||||
BASE=$($TMUX list-panes -F '#{pane_id}' | head -1)
|
||||
$TMUX select-pane -t "$BASE" -T TILED0 || fail "set tiled title failed"
|
||||
|
||||
$TMUX2 new-session -d -x 100 -y 30 "$TMUX attach -t inner" ||
|
||||
fail "outer session failed"
|
||||
sleep 1
|
||||
OUTER=$($TMUX2 list-panes -F '#{pane_id}' | head -1)
|
||||
$TMUX2 capture-pane -p -t "$OUTER" >$TMP || fail "initial capture failed"
|
||||
grep -q TILED0 $TMP || fail "initial tiled title not visible"
|
||||
|
||||
# Keep new-pane and send-keys in one command queue. send-keys targets the new
|
||||
# active floating pane, exactly as in: new\; newp\; send-keys "cat ..." enter.
|
||||
$TMUX new-pane -T FLOAT0 sh \; send-keys "cat '$FIXTURE'" Enter ||
|
||||
fail "queued floating image command failed"
|
||||
sleep 1
|
||||
$TMUX2 capture-pane -p -t "$OUTER" >$TMP || fail "capture failed"
|
||||
expect_title TILED0 tiled-after-sixel
|
||||
expect_title FLOAT0 floating-after-sixel
|
||||
|
||||
# Add another tiled pane, then create another floating pane and immediately
|
||||
# output the same SIXEL. Every tiled and floating border-status must remain.
|
||||
$TMUX select-pane -t "$BASE"
|
||||
TILED1=$($TMUX split-window -h -d -PF '#{pane_id}' sh) ||
|
||||
fail "split tiled pane failed"
|
||||
$TMUX select-pane -t "$TILED1" -T TILED1 || fail "set second tiled title failed"
|
||||
$TMUX new-pane -T FLOAT1 sh \; send-keys "cat '$FIXTURE'" Enter ||
|
||||
fail "queued second floating image command failed"
|
||||
sleep 1
|
||||
$TMUX2 capture-pane -p -t "$OUTER" >$TMP || fail "capture failed"
|
||||
expect_title TILED0 first-tiled-after-split-sixel
|
||||
expect_title TILED1 second-tiled-after-split-sixel
|
||||
expect_title FLOAT1 floating-after-split-sixel
|
||||
[ -z "$missing_titles" ] || fail "missing pane-border-status titles:$missing_titles"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user