diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-15 17:46:47 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-15 17:46:47 +0100 |
| commit | 1eebc384f60b73f8c0dbcd2dbcb1ce578702be46 (patch) | |
| tree | 7727b565d30698024cdf230bf035a8273a135f7d /scripts/ux-check.sh | |
| parent | 0.6.1: redraw from the caret row, not the block height (diff) | |
| download | agent686-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/ux-check.sh')
| -rwxr-xr-x | scripts/ux-check.sh | 24 |
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" |
| 79 | fi | 79 | fi |
| 80 | 80 | ||
| 81 | # Resizing while typing must not duplicate the prompt or erase what is above it. | ||
| 82 | printf 'ZEBRA alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu' \ | ||
| 83 | | tmux load-buffer -b uxresize - | ||
| 84 | tmux paste-buffer -p -b uxresize -t "$session" | ||
| 85 | sleep 0.5 | ||
| 86 | tmux resize-window -t "$session" -x 40 -y 24 | ||
| 87 | sleep 0.6 | ||
| 88 | screen=$(tmux capture-pane -p -t "$session") | ||
| 89 | [ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \ | ||
| 90 | || fail_msg "resizing to 40 columns duplicated the prompt" | ||
| 91 | echo "$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. | ||
| 95 | tmux send-keys -t "$session" End | ||
| 96 | sleep 0.3 | ||
| 97 | tmux send-keys -t "$session" -l "!" | ||
| 98 | sleep 0.4 | ||
| 99 | screen=$(tmux capture-pane -p -t "$session") | ||
| 100 | [ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \ | ||
| 101 | || fail_msg "redrawing after a resize duplicated the prompt" | ||
| 102 | echo "$screen" | grep -q "Hello from the mock provider" \ | ||
| 103 | || fail_msg "redrawing after a resize erased output above" | ||
| 104 | |||
| 81 | if [ "$fail" -ne 0 ]; then | 105 | if [ "$fail" -ne 0 ]; then |
| 82 | echo "--- final screen ---" >&2 | 106 | echo "--- final screen ---" >&2 |
| 83 | echo "$screen" >&2 | 107 | echo "$screen" >&2 |
