From 1eebc384f60b73f8c0dbcd2dbcb1ce578702be46 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 17:46:47 +0100 Subject: 0.6.2: resizing no longer duplicates the prompt The terminal reflows the input block and moves the caret with it, so drawing on resize produced a second copy. Recompute the caret's row and let the next redraw work from the reflowed block. Documented the dependency on reflowing terminals. --- scripts/ux-check.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'scripts/ux-check.sh') diff --git a/scripts/ux-check.sh b/scripts/ux-check.sh index 019f63d..204fc98 100755 --- a/scripts/ux-check.sh +++ b/scripts/ux-check.sh @@ -78,6 +78,30 @@ if echo "$screen" | grep -q 'line two.*Hello from the mock'; then fail_msg "the answer was written on the same line as the prompt" fi +# Resizing while typing must not duplicate the prompt or erase what is above it. +printf 'ZEBRA alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu' \ + | tmux load-buffer -b uxresize - +tmux paste-buffer -p -b uxresize -t "$session" +sleep 0.5 +tmux resize-window -t "$session" -x 40 -y 24 +sleep 0.6 +screen=$(tmux capture-pane -p -t "$session") +[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \ + || fail_msg "resizing to 40 columns duplicated the prompt" +echo "$screen" | grep -q "Hello from the mock provider" \ + || fail_msg "resizing erased the output above the prompt" + +# Typing after the resize must redraw in the right place. +tmux send-keys -t "$session" End +sleep 0.3 +tmux send-keys -t "$session" -l "!" +sleep 0.4 +screen=$(tmux capture-pane -p -t "$session") +[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \ + || fail_msg "redrawing after a resize duplicated the prompt" +echo "$screen" | grep -q "Hello from the mock provider" \ + || fail_msg "redrawing after a resize erased output above" + if [ "$fail" -ne 0 ]; then echo "--- final screen ---" >&2 echo "$screen" >&2 -- cgit v1.2.3