summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-15 17:46:47 +0100
committersalmonik <salmonik@tuta.io>2026-11-15 17:46:47 +0100
commit1eebc384f60b73f8c0dbcd2dbcb1ce578702be46 (patch)
tree7727b565d30698024cdf230bf035a8273a135f7d /scripts
parent0.6.1: redraw from the caret row, not the block height (diff)
downloadagent686-1eebc384f60b73f8c0dbcd2dbcb1ce578702be46.tar.gz
agent686-1eebc384f60b73f8c0dbcd2dbcb1ce578702be46.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ux-check.sh24
1 files changed, 24 insertions, 0 deletions
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
78 fail_msg "the answer was written on the same line as the prompt" 78 fail_msg "the answer was written on the same line as the prompt"
79fi 79fi
80 80
81# Resizing while typing must not duplicate the prompt or erase what is above it.
82printf 'ZEBRA alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu' \
83 | tmux load-buffer -b uxresize -
84tmux paste-buffer -p -b uxresize -t "$session"
85sleep 0.5
86tmux resize-window -t "$session" -x 40 -y 24
87sleep 0.6
88screen=$(tmux capture-pane -p -t "$session")
89[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \
90 || fail_msg "resizing to 40 columns duplicated the prompt"
91echo "$screen" | grep -q "Hello from the mock provider" \
92 || fail_msg "resizing erased the output above the prompt"
93
94# Typing after the resize must redraw in the right place.
95tmux send-keys -t "$session" End
96sleep 0.3
97tmux send-keys -t "$session" -l "!"
98sleep 0.4
99screen=$(tmux capture-pane -p -t "$session")
100[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \
101 || fail_msg "redrawing after a resize duplicated the prompt"
102echo "$screen" | grep -q "Hello from the mock provider" \
103 || fail_msg "redrawing after a resize erased output above"
104
81if [ "$fail" -ne 0 ]; then 105if [ "$fail" -ne 0 ]; then
82 echo "--- final screen ---" >&2 106 echo "--- final screen ---" >&2
83 echo "$screen" >&2 107 echo "$screen" >&2