diff --git a/regress/screen-redraw-bidi.sh b/regress/screen-redraw-bidi.sh new file mode 100644 index 000000000..e4e962950 --- /dev/null +++ b/regress/screen-redraw-bidi.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +# Exercise screen-redraw.c bidirectional-isolate handling. When the client is +# UTF-8 and its terminal has the Bidi capability, each drawn span is wrapped in +# directional isolate characters (U+2066 .. U+2069) so a bidi terminal does not +# reorder pane contents across borders (the REDRAW_ISOLATES path). +# +# The Bidi capability is added with terminal-overrides before the client +# attaches, so the attached client picks it up. The isolate characters appear in +# the captured output around each span. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +new_scene() { + $TMUX2 neww -d "sh -c 'printf \"BIDI-LEFT 12345\nBIDI-RIGHT 67890\"; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y12 || exit 1 +} + +C="sh -c 'printf \"BIDI-PANE 12345\nBIDI-PANE 67890\"; exec sleep 100'" + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y12 "sh -c 'printf \"BIDI-BASE 12345\nBIDI-BASE 67890\"; exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 +# Add the Bidi capability before the client attaches. +$TMUX2 set -ag terminal-overrides ",*:Bidi=\\E[8h" || exit 1 + +$TMUX new -d -x40 -y12 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Single pane: content is wrapped in isolates. +new_scene +compare bidi-single + +# Two panes: borders and both panes are isolated. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +compare bidi-split + +exit 0 diff --git a/regress/screen-redraw-cache.sh b/regress/screen-redraw-cache.sh new file mode 100644 index 000000000..27c98e3b4 --- /dev/null +++ b/regress/screen-redraw-cache.sh @@ -0,0 +1,162 @@ +#!/bin/sh + +# Exercise the scene caching in screen-redraw.c. A scene is built once and reused +# until it is invalidated; redraw_get_scene rebuilds it when the window changes, +# the generation number is bumped (panes moved/resized/swapped), or the offset +# changes. These tests make such a change in place and capture afterwards: if the +# matching invalidation did not fire, the stale cached scene would be drawn and +# the capture would not match the golden. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. The +# outer pane is captured and compared with a golden in screen-redraw-results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +new_scene() { + $TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"BASE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y14 || exit 1 +} + +C="sh -c 'i=0; while [ \$i -lt 5 ]; do printf \"PANE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y14 "sh -c 'exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 + +$TMUX new -d -x40 -y14 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# --- Generation change: a pane is resized in place. --- + +# Two columns; first capture pins the initial divider position. The scene is +# built here and cached. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare cache-resize-before + +# Move the divider left. resize-pane bumps the generation, so the cached scene +# must be rebuilt and the divider must appear in its new position. +$TMUX2 resize-pane -t0 -L 6 || exit 1 +compare cache-resize-after + +# --- Generation change: panes are swapped/rotated in place. --- + +# Three columns, each pane titled so the order is visible. The pane status line +# makes a swap show up in the captured scene. +new_scene +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t:.0 -T AAA || exit 1 +$TMUX2 selectp -t:.1 -T BBB || exit 1 +$TMUX2 selectp -t:.2 -T CCC || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare cache-rotate-before + +# Rotate the panes; the titles must move with them in the rebuilt scene. +# rotate-window keeps the cell geometry, so only its scene invalidation makes +# this differ from cache-rotate-before. +$TMUX2 rotate-window || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare cache-rotate-after + +# --- Generation change: two panes swapped in place. --- + +# swap-pane likewise moves panes between cells without changing geometry; the +# swapped titles must appear in the rebuilt scene. +new_scene +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t:.0 -T LEFT || exit 1 +$TMUX2 selectp -t:.1 -T RIGHT || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare cache-swap-before + +$TMUX2 swap-pane -d -s:.0 -t:.1 || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare cache-swap-after + +# --- Window change: the client switches between two differently laid out +# windows and back. The scene is keyed on the window, so each must show its own +# layout and switching back must not show the other window's cached scene. --- + +# Window A: a single pane (no internal border). +$TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"WINA%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 selectw -t:\$ || exit 1 +$TMUX2 resizew -x40 -y14 || exit 1 +A=$($TMUX2 display -p '#{window_id}') || exit 1 + +# Window B: a top/bottom split (a horizontal border). +$TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"WINB%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 selectw -t:\$ || exit 1 +$TMUX2 resizew -x40 -y14 || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +B=$($TMUX2 display -p '#{window_id}') || exit 1 + +$TMUX2 selectw -t$A || exit 1 +compare cache-window-a +$TMUX2 selectw -t$B || exit 1 +compare cache-window-b +$TMUX2 selectw -t$A || exit 1 +compare cache-window-a-again + +# --- Size change: the client (and so the scene) is resized. --- + +# With window-size latest the inner window tracks the client size, so resizing +# the outer window resizes the inner client and the scene. The cached scene must +# be rebuilt at the new size (the scene->sx/sy mismatch path in +# redraw_get_scene), not drawn at the old size. +$TMUX2 set -g window-size latest || exit 1 +$TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"SIZE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 selectw -t:\$ || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +compare cache-resizeclient-before + +$TMUX resizew -x30 -y10 || exit 1 +compare cache-resizeclient-after + +exit 0 diff --git a/regress/screen-redraw-floating.sh b/regress/screen-redraw-floating.sh new file mode 100644 index 000000000..82c36d364 --- /dev/null +++ b/regress/screen-redraw-floating.sh @@ -0,0 +1,221 @@ +#!/bin/sh + +# Exercise screen-redraw.c drawing of floating panes: their borders and titles, +# clipping at the window edge, and the interaction with the area outside the +# window (when the window is smaller than the attached client). +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer pane is captured (the full client scene drawn by screen-redraw.c) +# and compared with a golden file in screen_redraw_results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p $2 >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +# new_scene : fresh inner window of the given window size. +new_scene() { + $TMUX2 neww -d "sh -c 'printf base; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x$1 -y$2 || exit 1 +} + +# tile_2x2: split the current window into a 2x2 grid of tiled panes. +tile_2x2() { + C="sh -c 'exec sleep 100'" + $TMUX2 splitw -h "$C" || exit 1 + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 selectp -t0 || exit 1 + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 select-layout tiled || exit 1 +} + +# fill_base_pattern: make clipped floating panes visibly cover every column. +fill_base_pattern() { + $TMUX2 respawnp -k "sh -c 'i=0; while [ \$i -lt 12 ]; do printf \"%02d:abcdefghijklmnopqrstuvwxyz0123456789\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +} + +# fill_all_panes: make each pane visibly nonblank. +fill_all_panes() { + for pane in $($TMUX2 list-panes -F '#{pane_id}'); do + $TMUX2 respawnp -k -t "$pane" "sh -c 'i=0; while [ \$i -lt 5 ]; do printf \"TILE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 + done +} + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y12 "sh -c 'printf base; exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 +$TMUX2 set -g pane-border-format " #{pane_title} " || exit 1 + +$TMUX new -d -x40 -y12 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Basic floating pane, well inside the window. +new_scene 40 12 +$TMUX2 new-pane -x20 -y6 -X8 -Y3 "sh -c 'printf FLOAT; exec sleep 100'" || exit 1 +compare floating-basic + +# Floating pane with a title on its border. pane-border-status also draws the +# base pane's title, so set it explicitly (the default is the hostname, which is +# not stable). +new_scene 40 12 +$TMUX2 setw pane-border-status top || exit 1 +$TMUX2 selectp -t:.0 -T base || exit 1 +$TMUX2 new-pane -x20 -y6 -X8 -Y2 -T title \ + "sh -c 'printf FLOAT; exec sleep 100'" || exit 1 +compare floating-title + +# Larger floating pane with double border lines. +new_scene 40 12 +$TMUX2 new-pane -x28 -y8 -X4 -Y1 -B double \ + "sh -c 'printf FLOAT; exec sleep 100'" || exit 1 +compare floating-border-double + +# Floating pane with no border lines: redraw_mark_pane_borders returns early so +# the float has no border at all, only its (clipped) content over the base pane. +new_scene 40 12 +$TMUX2 new-pane -x20 -y6 -X10 -Y3 -B none \ + "sh -c 'printf NOBORDER; exec sleep 100'" || exit 1 +compare floating-noborder + +# Floating pane positioned past the right and bottom edges: must clip. +new_scene 40 12 +$TMUX2 new-pane -x20 -y6 -X30 -Y8 "sh -c 'printf CLIP; exec sleep 100'" || exit 1 +compare floating-clip-edge + +# Window smaller than the client (outside area filled), with a floating pane +# that overlaps the boundary into the outside region. +new_scene 28 8 +$TMUX2 new-pane -x16 -y5 -X18 -Y4 "sh -c 'printf OUT; exec sleep 100'" || exit 1 +compare floating-outside + +# Floating pane clipped at the top-left corner (negative offsets). +new_scene 40 12 +$TMUX2 new-pane -x18 -y6 -X-4 -Y-2 "sh -c 'printf TL; exec sleep 100'" || exit 1 +compare floating-clip-topleft + +# Floating panes clipped at each edge. The patterned base pane makes sure the +# clipped edge still obscures both content and borders underneath. +new_scene 40 12 +fill_base_pattern +$TMUX2 new-pane -x20 -y6 -X-10 -Y3 "sh -c 'printf LEFT; exec sleep 100'" || exit 1 +compare floating-clip-left + +new_scene 40 12 +fill_base_pattern +$TMUX2 new-pane -x20 -y6 -X30 -Y3 "sh -c 'printf RIGHT; exec sleep 100'" || exit 1 +compare floating-clip-right + +new_scene 40 12 +fill_base_pattern +$TMUX2 new-pane -x20 -y6 -X10 -Y-3 "sh -c 'printf TOP; exec sleep 100'" || exit 1 +compare floating-clip-top + +new_scene 40 12 +fill_base_pattern +$TMUX2 new-pane -x20 -y6 -X10 -Y9 "sh -c 'printf BOTTOM; exec sleep 100'" || exit 1 +compare floating-clip-bottom + +# Floating pane over a tiled 2x2 grid: the float draws a complete box and must +# NOT merge its borders with the tiled pane borders underneath. +new_scene 40 12 +tile_2x2 +fill_all_panes +$TMUX2 new-pane -x16 -y6 -X11 -Y3 "sh -c 'printf FLT; exec sleep 100'" || exit 1 +compare floating-over-tiled + +# Same, but the float uses double border lines while the tiled panes use single: +# the two border styles must coexist without merging. +new_scene 40 12 +tile_2x2 +fill_all_panes +$TMUX2 new-pane -x16 -y6 -X11 -Y3 -B double \ + "sh -c 'printf FLT; exec sleep 100'" || exit 1 +compare floating-over-tiled-double + +# Two overlapping floating panes: the later (top) float draws over the earlier. +new_scene 40 12 +$TMUX2 new-pane -x16 -y6 -X4 -Y2 "sh -c 'printf AAA; exec sleep 100'" || exit 1 +$TMUX2 new-pane -x16 -y6 -X14 -Y6 "sh -c 'printf BBB; exec sleep 100'" || exit 1 +compare floating-overlap + +# Two floating panes with different per-pane configuration: one has its status on +# top with single borders, the other has its status on the bottom with heavy +# borders (pane-border-status and pane-border-lines are per-pane options). +new_scene 40 12 +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 new-pane -x16 -y4 -X3 -Y1 -T one \ + "sh -c 'printf ONE; exec sleep 100'" || exit 1 +$TMUX2 set -p pane-border-status top || exit 1 +$TMUX2 set -p pane-border-lines single || exit 1 +$TMUX2 new-pane -x16 -y4 -X18 -Y6 -T two \ + "sh -c 'printf TWO; exec sleep 100'" || exit 1 +$TMUX2 set -p pane-border-status bottom || exit 1 +$TMUX2 set -p pane-border-lines heavy || exit 1 +compare floating-mixed-config + +# Floating pane over a pane that has a scrollbar: the float must draw over the +# scrollbar. Captured with -e since the scrollbar is drawn with styles. +new_scene 40 12 +$TMUX2 setw pane-scrollbars on || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +$TMUX2 new-pane -x16 -y6 -X22 -Y3 "sh -c 'printf OVERSB; exec sleep 100'" || exit 1 +compare floating-over-scrollbar -e + +# Floating pane overlapping the client status line: the status line is not part +# of the window scene, so the float is clipped at the window's bottom edge. +new_scene 40 11 +$TMUX2 set status on || exit 1 +$TMUX2 set status-position bottom || exit 1 +$TMUX2 set status-format[0] "" || exit 1 +$TMUX2 new-pane -x20 -y6 -X8 -Y7 "sh -c 'printf OVERST; exec sleep 100'" || exit 1 +compare floating-over-status + +# A window left with only a floating pane: killing the single tiled pane removes +# it from the layout, so the area it occupied is no longer owned by any pane and +# is drawn as EMPTY cells (middle dots) around the float. This is the only way to +# produce a REDRAW_SPAN_EMPTY span. +new_scene 40 12 +$TMUX2 new-pane -x20 -y6 -X8 -Y3 "sh -c 'printf FLOAT; exec sleep 100'" || exit 1 +tiled=$($TMUX2 list-panes -F '#{pane_floating_flag} #{pane_id}' | \ + awk '$1==0{print $2; exit}') || exit 1 +$TMUX2 kill-pane -t "$tiled" || exit 1 +compare floating-empty + +exit 0 diff --git a/regress/screen-redraw-indicators.sh b/regress/screen-redraw-indicators.sh new file mode 100644 index 000000000..60bf652b2 --- /dev/null +++ b/regress/screen-redraw-indicators.sh @@ -0,0 +1,212 @@ +#!/bin/sh + +# Exercise screen-redraw.c pane-border-indicators: the arrow indicators that +# point at the active pane, and the two-pane border colour split. +# +# Arrows are drawn as glyphs (captured plain). The two-pane colour split is +# drawn with styles, so that scene is captured with escapes (-e) and uses +# distinct active/inactive border styles so the split is visible. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer pane is captured and compared with a golden in screen-redraw-results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +# compare [-e]: capture the outer pane and compare (or generate). +compare() { + sleep 1 + $TMUX capturep -p $2 >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +new_scene() { + $TMUX2 neww -d "sh -c 'exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y12 || exit 1 +} + +C="sh -c 'exec sleep 100'" + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y12 "sh -c 'exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 + +$TMUX new -d -x40 -y12 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# --- Arrows: must appear for whichever pane is active (GitHub #4780). --- + +$TMUX2 set -g pane-border-indicators arrows || exit 1 + +# Two panes, left active: arrow points left. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare arrows-2pane-left + +# Two panes, right active: arrow points right (the case that regressed). +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t1 || exit 1 +compare arrows-2pane-right + +# Three columns, middle active. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t1 || exit 1 +compare arrows-3pane + +# Four panes (2x2), one active. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 select-layout tiled || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare arrows-4pane + +# --- Two-pane border colour split. --- + +# Distinct active/inactive styles so the coloured halves are visible; captured +# with -e to record the SGR. +$TMUX2 set -g pane-border-indicators colour || exit 1 + +# Left/right split: the border is vertical and is split into a top half (active +# pane colour) and a bottom half (the LAYOUT_LEFTRIGHT case). +new_scene +$TMUX2 setw pane-active-border-style fg=red || exit 1 +$TMUX2 setw pane-border-style fg=green || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare two-pane-colour-vertical -e + +# Top/bottom split: the border is horizontal and is split into a left half and a +# right half instead (the LAYOUT_TOPBOTTOM case). +new_scene +$TMUX2 setw pane-active-border-style fg=red || exit 1 +$TMUX2 setw pane-border-style fg=green || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare two-pane-colour-horizontal -e + +# The colour split only applies with exactly two tiled panes. With three panes +# the split is suppressed: the whole border uses the active pane's colour and +# there is no coloured half (redraw_check_two_pane_colours returns 0). +new_scene +$TMUX2 setw pane-active-border-style fg=red || exit 1 +$TMUX2 setw pane-border-style fg=green || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare colour-three-suppressed -e + +# A floating pane is ignored by the two-pane count, so two tiled panes plus a +# float still split. The float itself is never coloured by the indicator. +new_scene +$TMUX2 setw pane-active-border-style fg=red || exit 1 +$TMUX2 setw pane-border-style fg=green || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 new-pane -x16 -y6 -X10 -Y2 "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare colour-two-plus-float -e + +# --- Both indicators together. --- + +# pane-border-indicators both enables the arrow and the colour split at once +# (it satisfies both the arrow and the colour branches). Two panes so the colour +# split also applies. +$TMUX2 set -g pane-border-indicators both || exit 1 +new_scene +$TMUX2 setw pane-active-border-style fg=red || exit 1 +$TMUX2 setw pane-border-style fg=green || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare indicators-both -e + +# --- Marked pane. --- + +# A marked pane (select-pane -m) has its border drawn reversed. Captured with -e +# to record the reverse attribute. The marked pane is made non-active so its +# reversed border is distinct from the active pane. +$TMUX2 set -g pane-border-indicators off || exit 1 + +# Left/right split, right pane marked. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 selectp -t1 -m || exit 1 +compare marked-pane-lr -e + +# Top/bottom split, bottom pane marked. +new_scene +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 selectp -t1 -m || exit 1 +compare marked-pane-tb -e + +# Three columns, middle pane marked (reversed border on both sides). +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 selectp -t1 -m || exit 1 +compare marked-pane-three -e + +# Floating pane marked: the whole floating box border is reversed. +new_scene +$TMUX2 new-pane -x20 -y6 -X8 -Y3 "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 selectp -t1 -m || exit 1 +compare marked-pane-float -e + +# Marked pane together with a pane status line: the title border is reversed too. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 setw pane-border-format " #{pane_index}:#{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +$TMUX2 selectp -t:.0 -T left || exit 1 +$TMUX2 selectp -t:.1 -T right || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 selectp -t1 -m || exit 1 +compare marked-pane-status -e + +exit 0 diff --git a/regress/screen-redraw-outside.sh b/regress/screen-redraw-outside.sh new file mode 100644 index 000000000..53a2a72b1 --- /dev/null +++ b/regress/screen-redraw-outside.sh @@ -0,0 +1,116 @@ +#!/bin/sh + +# Exercise screen-redraw.c when the window is smaller than the attached client, +# so part of the client is outside the window. screen-redraw.c fills the outside +# area and draws a real border along the window's right and/or bottom edge (not +# just where panes meet). This checks redraw_get_window_offset and the OUTSIDE +# span handling, including how the window-edge border joins the pane borders. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer client is 40x14; the inner window is made smaller with resizew. The +# outer pane is captured and compared with a golden in screen-redraw-results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +# new_scene : fresh inner window smaller than the 40x14 client. +new_scene() { + $TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt $(($2 - 1)) ]; do printf \"OUT%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x$1 -y$2 || exit 1 +} + +C="sh -c 'i=0; while [ \$i -lt 8 ]; do printf \"PAN%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y14 "sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"OUT%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 + +$TMUX new -d -x40 -y14 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Single pane, narrower than the client: a border along the right edge. +new_scene 28 14 +compare outside-right-single + +# Narrower than the client with a left/right split: the inter-pane border plus a +# real border on the window's right edge, then the outside area. +new_scene 28 14 +$TMUX2 splitw -h "$C" || exit 1 +compare outside-right-split + +# Shorter than the client with a top/bottom split: a real border on the window's +# bottom edge. +new_scene 40 9 +$TMUX2 splitw -v "$C" || exit 1 +compare outside-bottom-split + +# Smaller in both dimensions with a 2x2 grid: borders on the right and bottom +# edges meeting the internal pane borders at the corner. +new_scene 28 9 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 select-layout tiled || exit 1 +compare outside-both-2x2 + +# Window BIGGER than the client: only part of the window is viewed and the view +# can be panned (refresh-client). This exercises a non-zero scene offset. +# A 2x2 grid in a 60x20 window viewed through the 40x14 client. +new_scene 60 20 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 select-layout tiled || exit 1 + +# Default view: the top-left of the window. +$TMUX2 refresh-client -U 100 || exit 1 +$TMUX2 refresh-client -L 100 || exit 1 +compare bigger-topleft + +# Panned to the bottom-right of the window (down and right to the limit). +$TMUX2 refresh-client -D 100 || exit 1 +$TMUX2 refresh-client -R 100 || exit 1 +compare bigger-bottomright + +exit 0 diff --git a/regress/screen-redraw-popups.sh b/regress/screen-redraw-popups.sh new file mode 100644 index 000000000..1eb7e5897 --- /dev/null +++ b/regress/screen-redraw-popups.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# Exercise drawing of popups (display-popup) over the window scene. A popup is an +# overlay drawn on top of the redraw scene (the overlay_draw path in +# screen-redraw.c), so this guards against regressions in how popups appear. +# +# A popup is modal and stays open until its command exits, so each scene fully +# re-creates the servers and re-attaches; the popup is opened in the background +# (display-popup blocks the client that runs it) and the outer pane is captured +# while it is open. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +C="sh -c 'i=0; while [ \$i -lt 13 ]; do printf \"POP%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" + +# setup: fresh inner window attached inside a fresh outer pane, 40x14. +setup() { + $TMUX kill-server 2>/dev/null + $TMUX2 kill-server 2>/dev/null + $TMUX2 new -d -x40 -y14 "$C" || exit 1 + $TMUX2 set -g status off || exit 1 + $TMUX2 set -g window-size manual || exit 1 + $TMUX2 resizew -x40 -y14 || exit 1 + $TMUX new -d -x40 -y14 || exit 1 + $TMUX set -g status off || exit 1 + $TMUX set -g window-size manual || exit 1 + $TMUX set -g default-terminal "tmux-256color" || exit 1 + $TMUX send -l "$TMUX2 attach" || exit 1 + $TMUX send Enter || exit 1 + sleep 1 +} + +# popup : open a popup running a fixed command, in the background (it stays +# open because the command sleeps; the servers are killed at the next setup). +popup() { + $TMUX2 display-popup "$@" -E "sh -c 'printf POPUP; exec sleep 100'" & + sleep 1 +} + +# Basic popup over a single pane. +setup +popup -w20 -h6 -x6 -y3 +compare popup-basic + +# Popup over a split: drawn on top of the pane border. +setup +$TMUX2 splitw -h "$C" || exit 1 +popup -w24 -h8 -x8 -y3 +compare popup-over-split + +# Popup with no border lines (-B). +setup +popup -B -w20 -h6 -x6 -y3 +compare popup-noborder + +# Popup with double border lines. +setup +popup -b double -w20 -h6 -x6 -y3 +compare popup-double + +exit 0 diff --git a/regress/screen-redraw-results/arrows-2pane-left.result b/regress/screen-redraw-results/arrows-2pane-left.result new file mode 100644 index 000000000..2f59b596f --- /dev/null +++ b/regress/screen-redraw-results/arrows-2pane-left.result @@ -0,0 +1,12 @@ + │ + ← + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/arrows-2pane-right.result b/regress/screen-redraw-results/arrows-2pane-right.result new file mode 100644 index 000000000..fe3080300 --- /dev/null +++ b/regress/screen-redraw-results/arrows-2pane-right.result @@ -0,0 +1,12 @@ + │ + → + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/arrows-3pane.result b/regress/screen-redraw-results/arrows-3pane.result new file mode 100644 index 000000000..b9d3ef6f2 --- /dev/null +++ b/regress/screen-redraw-results/arrows-3pane.result @@ -0,0 +1,12 @@ + │ │ + → ← + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/arrows-4pane.result b/regress/screen-redraw-results/arrows-4pane.result new file mode 100644 index 000000000..695fec7e6 --- /dev/null +++ b/regress/screen-redraw-results/arrows-4pane.result @@ -0,0 +1,12 @@ + │ + ← + │ + │ + │ +─↑─────────────────┼──────────────────── + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/bidi-single.result b/regress/screen-redraw-results/bidi-single.result new file mode 100644 index 000000000..874e62e1b --- /dev/null +++ b/regress/screen-redraw-results/bidi-single.result @@ -0,0 +1,12 @@ +BIDI-LEFT 12345 +BIDI-RIGHT 67890 + + + + + + + + + + diff --git a/regress/screen-redraw-results/bidi-split.result b/regress/screen-redraw-results/bidi-split.result new file mode 100644 index 000000000..654695f18 --- /dev/null +++ b/regress/screen-redraw-results/bidi-split.result @@ -0,0 +1,12 @@ +BIDI-LEFT 12345 ⁩│⁦BIDI-PANE 12345 +BIDI-RIGHT 67890 ⁩│⁦BIDI-PANE 67890 + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ + ⁩│⁦ diff --git a/regress/screen-redraw-results/bigger-bottomright.result b/regress/screen-redraw-results/bigger-bottomright.result new file mode 100644 index 000000000..8840fa2b1 --- /dev/null +++ b/regress/screen-redraw-results/bigger-bottomright.result @@ -0,0 +1,14 @@ + │PAN06 abcdefghij + │PAN07 abcdefghij + │ +─────────┼────────────────────────────── + │PAN00 abcdefghij + │PAN01 abcdefghij + │PAN02 abcdefghij + │PAN03 abcdefghij + │PAN04 abcdefghij + │PAN05 abcdefghij + │PAN06 abcdefghij + │PAN07 abcdefghij + │ + │ diff --git a/regress/screen-redraw-results/bigger-topleft.result b/regress/screen-redraw-results/bigger-topleft.result new file mode 100644 index 000000000..4f1e482cf --- /dev/null +++ b/regress/screen-redraw-results/bigger-topleft.result @@ -0,0 +1,14 @@ +OUT11 abcdefghij │PAN00 abcd +OUT12 abcdefghij │PAN01 abcd +OUT13 abcdefghij │PAN02 abcd +OUT14 abcdefghij │PAN03 abcd +OUT15 abcdefghij │PAN04 abcd +OUT16 abcdefghij │PAN05 abcd +OUT17 abcdefghij │PAN06 abcd +OUT18 abcdefghij │PAN07 abcd + │ +─────────────────────────────┼────────── +PAN00 abcdefghij │PAN00 abcd +PAN01 abcdefghij │PAN01 abcd +PAN02 abcdefghij │PAN02 abcd +PAN03 abcdefghij │PAN03 abcd diff --git a/regress/screen-redraw-results/cache-resize-after.result b/regress/screen-redraw-results/cache-resize-after.result new file mode 100644 index 000000000..163f853d2 --- /dev/null +++ b/regress/screen-redraw-results/cache-resize-after.result @@ -0,0 +1,14 @@ +hij │PANE00 abcdefghij +BASE07 abcdefg│PANE01 abcdefghij +hij │PANE02 abcdefghij +BASE08 abcdefg│PANE03 abcdefghij +hij │PANE04 abcdefghij +BASE09 abcdefg│ +hij │ +BASE10 abcdefg│ +hij │ +BASE11 abcdefg│ +hij │ +BASE12 abcdefg│ +hij │ + │ diff --git a/regress/screen-redraw-results/cache-resize-before.result b/regress/screen-redraw-results/cache-resize-before.result new file mode 100644 index 000000000..ee18481f7 --- /dev/null +++ b/regress/screen-redraw-results/cache-resize-before.result @@ -0,0 +1,14 @@ +BASE00 abcdefghij │PANE00 abcdefghij +BASE01 abcdefghij │PANE01 abcdefghij +BASE02 abcdefghij │PANE02 abcdefghij +BASE03 abcdefghij │PANE03 abcdefghij +BASE04 abcdefghij │PANE04 abcdefghij +BASE05 abcdefghij │ +BASE06 abcdefghij │ +BASE07 abcdefghij │ +BASE08 abcdefghij │ +BASE09 abcdefghij │ +BASE10 abcdefghij │ +BASE11 abcdefghij │ +BASE12 abcdefghij │ + │ diff --git a/regress/screen-redraw-results/cache-resizeclient-after.result b/regress/screen-redraw-results/cache-resizeclient-after.result new file mode 100644 index 000000000..675012f0d --- /dev/null +++ b/regress/screen-redraw-results/cache-resizeclient-after.result @@ -0,0 +1,10 @@ +SIZE09 abcdefghij +SIZE10 abcdefghij +SIZE11 abcdefghij +SIZE12 abcdefghij + +────────────────────────────── +PANE02 abcdefghij +PANE03 abcdefghij +PANE04 abcdefghij + diff --git a/regress/screen-redraw-results/cache-resizeclient-before.result b/regress/screen-redraw-results/cache-resizeclient-before.result new file mode 100644 index 000000000..48c1058c3 --- /dev/null +++ b/regress/screen-redraw-results/cache-resizeclient-before.result @@ -0,0 +1,14 @@ +SIZE07 abcdefghij +SIZE08 abcdefghij +SIZE09 abcdefghij +SIZE10 abcdefghij +SIZE11 abcdefghij +SIZE12 abcdefghij + +──────────────────────────────────────── +PANE00 abcdefghij +PANE01 abcdefghij +PANE02 abcdefghij +PANE03 abcdefghij +PANE04 abcdefghij + diff --git a/regress/screen-redraw-results/cache-rotate-after.result b/regress/screen-redraw-results/cache-rotate-after.result new file mode 100644 index 000000000..15acf7bb3 --- /dev/null +++ b/regress/screen-redraw-results/cache-rotate-after.result @@ -0,0 +1,14 @@ +── BBB ───┬── CCC ──┬── AAA ──────────── +PANE00 abc│cdefghij │BASE01 abcdefghij +defghij │PANE03 ab│BASE02 abcdefghij +PANE01 abc│cdefghij │BASE03 abcdefghij +defghij │PANE04 ab│BASE04 abcdefghij +PANE02 abc│cdefghij │BASE05 abcdefghij +defghij │ │BASE06 abcdefghij +PANE03 abc│ │BASE07 abcdefghij +defghij │ │BASE08 abcdefghij +PANE04 abc│ │BASE09 abcdefghij +defghij │ │BASE10 abcdefghij + │ │BASE11 abcdefghij + │ │BASE12 abcdefghij + │ │ diff --git a/regress/screen-redraw-results/cache-rotate-before.result b/regress/screen-redraw-results/cache-rotate-before.result new file mode 100644 index 000000000..856946d17 --- /dev/null +++ b/regress/screen-redraw-results/cache-rotate-before.result @@ -0,0 +1,14 @@ +── AAA ───┬── BBB ──┬── CCC ──────────── +BASE07 abc│PANE00 ab│PANE00 abcdefghij +defghij │cdefghij │PANE01 abcdefghij +BASE08 abc│PANE01 ab│PANE02 abcdefghij +defghij │cdefghij │PANE03 abcdefghij +BASE09 abc│PANE02 ab│PANE04 abcdefghij +defghij │cdefghij │ +BASE10 abc│PANE03 ab│ +defghij │cdefghij │ +BASE11 abc│PANE04 ab│ +defghij │cdefghij │ +BASE12 abc│ │ +defghij │ │ + │ │ diff --git a/regress/screen-redraw-results/cache-swap-after.result b/regress/screen-redraw-results/cache-swap-after.result new file mode 100644 index 000000000..87424c1bf --- /dev/null +++ b/regress/screen-redraw-results/cache-swap-after.result @@ -0,0 +1,14 @@ +── RIGHT ───────────┬── LEFT ─────────── +PANE00 abcdefghij │BASE01 abcdefghij +PANE01 abcdefghij │BASE02 abcdefghij +PANE02 abcdefghij │BASE03 abcdefghij +PANE03 abcdefghij │BASE04 abcdefghij +PANE04 abcdefghij │BASE05 abcdefghij + │BASE06 abcdefghij + │BASE07 abcdefghij + │BASE08 abcdefghij + │BASE09 abcdefghij + │BASE10 abcdefghij + │BASE11 abcdefghij + │BASE12 abcdefghij + │ diff --git a/regress/screen-redraw-results/cache-swap-before.result b/regress/screen-redraw-results/cache-swap-before.result new file mode 100644 index 000000000..3e84a9c4d --- /dev/null +++ b/regress/screen-redraw-results/cache-swap-before.result @@ -0,0 +1,14 @@ +── LEFT ────────────┬── RIGHT ────────── +BASE01 abcdefghij │PANE00 abcdefghij +BASE02 abcdefghij │PANE01 abcdefghij +BASE03 abcdefghij │PANE02 abcdefghij +BASE04 abcdefghij │PANE03 abcdefghij +BASE05 abcdefghij │PANE04 abcdefghij +BASE06 abcdefghij │ +BASE07 abcdefghij │ +BASE08 abcdefghij │ +BASE09 abcdefghij │ +BASE10 abcdefghij │ +BASE11 abcdefghij │ +BASE12 abcdefghij │ + │ diff --git a/regress/screen-redraw-results/cache-window-a-again.result b/regress/screen-redraw-results/cache-window-a-again.result new file mode 100644 index 000000000..093f62ba3 --- /dev/null +++ b/regress/screen-redraw-results/cache-window-a-again.result @@ -0,0 +1,14 @@ +WINA00 abcdefghij +WINA01 abcdefghij +WINA02 abcdefghij +WINA03 abcdefghij +WINA04 abcdefghij +WINA05 abcdefghij +WINA06 abcdefghij +WINA07 abcdefghij +WINA08 abcdefghij +WINA09 abcdefghij +WINA10 abcdefghij +WINA11 abcdefghij +WINA12 abcdefghij + diff --git a/regress/screen-redraw-results/cache-window-a.result b/regress/screen-redraw-results/cache-window-a.result new file mode 100644 index 000000000..093f62ba3 --- /dev/null +++ b/regress/screen-redraw-results/cache-window-a.result @@ -0,0 +1,14 @@ +WINA00 abcdefghij +WINA01 abcdefghij +WINA02 abcdefghij +WINA03 abcdefghij +WINA04 abcdefghij +WINA05 abcdefghij +WINA06 abcdefghij +WINA07 abcdefghij +WINA08 abcdefghij +WINA09 abcdefghij +WINA10 abcdefghij +WINA11 abcdefghij +WINA12 abcdefghij + diff --git a/regress/screen-redraw-results/cache-window-b.result b/regress/screen-redraw-results/cache-window-b.result new file mode 100644 index 000000000..f0c9fe683 --- /dev/null +++ b/regress/screen-redraw-results/cache-window-b.result @@ -0,0 +1,14 @@ +WINB07 abcdefghij +WINB08 abcdefghij +WINB09 abcdefghij +WINB10 abcdefghij +WINB11 abcdefghij +WINB12 abcdefghij + +──────────────────────────────────────── +PANE00 abcdefghij +PANE01 abcdefghij +PANE02 abcdefghij +PANE03 abcdefghij +PANE04 abcdefghij + diff --git a/regress/screen-redraw-results/colour-three-suppressed.result b/regress/screen-redraw-results/colour-three-suppressed.result new file mode 100644 index 000000000..718cf0365 --- /dev/null +++ b/regress/screen-redraw-results/colour-three-suppressed.result @@ -0,0 +1,12 @@ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/colour-two-plus-float.result b/regress/screen-redraw-results/colour-two-plus-float.result new file mode 100644 index 000000000..74ea83e12 --- /dev/null +++ b/regress/screen-redraw-results/colour-two-plus-float.result @@ -0,0 +1,12 @@ + │ + ┌────────────────┐ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + └────────────────┘ + │ + │ + │ diff --git a/regress/screen-redraw-results/cross-double.result b/regress/screen-redraw-results/cross-double.result new file mode 100644 index 000000000..3d2987213 --- /dev/null +++ b/regress/screen-redraw-results/cross-double.result @@ -0,0 +1,14 @@ + ║ + ║ + ║ + ║ + ║ + ║ +═══════════════════╬════════════════════ + ║ + ║ + ║ + ║ + ║ + ║ + ║ diff --git a/regress/screen-redraw-results/cross-heavy.result b/regress/screen-redraw-results/cross-heavy.result new file mode 100644 index 000000000..f379db1c7 --- /dev/null +++ b/regress/screen-redraw-results/cross-heavy.result @@ -0,0 +1,14 @@ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ +━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ diff --git a/regress/screen-redraw-results/cross-none.result b/regress/screen-redraw-results/cross-none.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/cross-none.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/cross-number.result b/regress/screen-redraw-results/cross-number.result new file mode 100644 index 000000000..8376b2377 --- /dev/null +++ b/regress/screen-redraw-results/cross-number.result @@ -0,0 +1,14 @@ + 1 + 1 + 1 + 1 + 1 + 1 +0000000000000000000011111111111111111111 + 2 + 2 + 2 + 2 + 2 + 2 + 2 diff --git a/regress/screen-redraw-results/cross-simple.result b/regress/screen-redraw-results/cross-simple.result new file mode 100644 index 000000000..1c6d94f9e --- /dev/null +++ b/regress/screen-redraw-results/cross-simple.result @@ -0,0 +1,14 @@ + | + | + | + | + | + | +-------------------+-------------------- + | + | + | + | + | + | + | diff --git a/regress/screen-redraw-results/cross-single.result b/regress/screen-redraw-results/cross-single.result new file mode 100644 index 000000000..d46a28346 --- /dev/null +++ b/regress/screen-redraw-results/cross-single.result @@ -0,0 +1,14 @@ + │ + │ + │ + │ + │ + │ +───────────────────┼──────────────────── + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/cross-spaces.result b/regress/screen-redraw-results/cross-spaces.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/cross-spaces.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/floating-basic.result b/regress/screen-redraw-results/floating-basic.result new file mode 100644 index 000000000..f51ccbe29 --- /dev/null +++ b/regress/screen-redraw-results/floating-basic.result @@ -0,0 +1,12 @@ +base + + ┌────────────────────┐ + │FLOAT │ + │ │ + │ │ + │ │ + │ │ + │ │ + └────────────────────┘ + + diff --git a/regress/screen-redraw-results/floating-border-double.result b/regress/screen-redraw-results/floating-border-double.result new file mode 100644 index 000000000..a1b1cd7a9 --- /dev/null +++ b/regress/screen-redraw-results/floating-border-double.result @@ -0,0 +1,12 @@ +bas╔════════════════════════════╗ + ║FLOAT ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ╚════════════════════════════╝ + + diff --git a/regress/screen-redraw-results/floating-clip-bottom.result b/regress/screen-redraw-results/floating-clip-bottom.result new file mode 100644 index 000000000..f8a11cdcf --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-bottom.result @@ -0,0 +1,12 @@ +01:abcdefghijklmnopqrstuvwxyz0123456789 +02:abcdefghijklmnopqrstuvwxyz0123456789 +03:abcdefghijklmnopqrstuvwxyz0123456789 +04:abcdefghijklmnopqrstuvwxyz0123456789 +05:abcdefghijklmnopqrstuvwxyz0123456789 +06:abcdefghijklmnopqrstuvwxyz0123456789 +07:abcdefghijklmnopqrstuvwxyz0123456789 +08:abcdefghijklmnopqrstuvwxyz0123456789 +09:abcdef┌────────────────────┐23456789 +10:abcdef│BOTTOM │23456789 +11:abcdef│ │23456789 + │ │ diff --git a/regress/screen-redraw-results/floating-clip-edge.result b/regress/screen-redraw-results/floating-clip-edge.result new file mode 100644 index 000000000..9998eff49 --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-edge.result @@ -0,0 +1,12 @@ +base + + + + + + + ┌────────── + │CLIP + │ + │ + │ diff --git a/regress/screen-redraw-results/floating-clip-left.result b/regress/screen-redraw-results/floating-clip-left.result new file mode 100644 index 000000000..f4c37c5da --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-left.result @@ -0,0 +1,12 @@ +01:abcdefghijklmnopqrstuvwxyz0123456789 +02:abcdefghijklmnopqrstuvwxyz0123456789 +──────────┐ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 + │ijklmnopqrstuvwxyz0123456789 +──────────┘ijklmnopqrstuvwxyz0123456789 +11:abcdefghijklmnopqrstuvwxyz0123456789 + diff --git a/regress/screen-redraw-results/floating-clip-right.result b/regress/screen-redraw-results/floating-clip-right.result new file mode 100644 index 000000000..24323b4ad --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-right.result @@ -0,0 +1,12 @@ +01:abcdefghijklmnopqrstuvwxyz0123456789 +02:abcdefghijklmnopqrstuvwxyz0123456789 +03:abcdefghijklmnopqrstuvwxyz┌────────── +04:abcdefghijklmnopqrstuvwxyz│RIGHT +05:abcdefghijklmnopqrstuvwxyz│ +06:abcdefghijklmnopqrstuvwxyz│ +07:abcdefghijklmnopqrstuvwxyz│ +08:abcdefghijklmnopqrstuvwxyz│ +09:abcdefghijklmnopqrstuvwxyz│ +10:abcdefghijklmnopqrstuvwxyz└────────── +11:abcdefghijklmnopqrstuvwxyz0123456789 + diff --git a/regress/screen-redraw-results/floating-clip-top.result b/regress/screen-redraw-results/floating-clip-top.result new file mode 100644 index 000000000..2a754ca65 --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-top.result @@ -0,0 +1,12 @@ +01:abcdef│ │23456789 +02:abcdef│ │23456789 +03:abcdef│ │23456789 +04:abcdef└────────────────────┘23456789 +05:abcdefghijklmnopqrstuvwxyz0123456789 +06:abcdefghijklmnopqrstuvwxyz0123456789 +07:abcdefghijklmnopqrstuvwxyz0123456789 +08:abcdefghijklmnopqrstuvwxyz0123456789 +09:abcdefghijklmnopqrstuvwxyz0123456789 +10:abcdefghijklmnopqrstuvwxyz0123456789 +11:abcdefghijklmnopqrstuvwxyz0123456789 + diff --git a/regress/screen-redraw-results/floating-clip-topleft.result b/regress/screen-redraw-results/floating-clip-topleft.result new file mode 100644 index 000000000..dbffb559e --- /dev/null +++ b/regress/screen-redraw-results/floating-clip-topleft.result @@ -0,0 +1,12 @@ + │ + │ + │ + │ +──────────────┘ + + + + + + + diff --git a/regress/screen-redraw-results/floating-empty.result b/regress/screen-redraw-results/floating-empty.result new file mode 100644 index 000000000..31a71de51 --- /dev/null +++ b/regress/screen-redraw-results/floating-empty.result @@ -0,0 +1,12 @@ +········································ +········································ +·······┌────────────────────┐··········· +·······│FLOAT │··········· +·······│ │··········· +·······│ │··········· +·······│ │··········· +·······│ │··········· +·······│ │··········· +·······└────────────────────┘··········· +········································ + diff --git a/regress/screen-redraw-results/floating-mixed-config.result b/regress/screen-redraw-results/floating-mixed-config.result new file mode 100644 index 000000000..ae6f2efba --- /dev/null +++ b/regress/screen-redraw-results/floating-mixed-config.result @@ -0,0 +1,12 @@ +ba┌── one ─────────┐ + │ONE │ + │ │ + │ │ + │ │ + └──────────────┏━━━━━━━━━━━━━━━━┓ + ┃TWO ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┗━━ two ━━━━━━━━━┛ + diff --git a/regress/screen-redraw-results/floating-noborder.result b/regress/screen-redraw-results/floating-noborder.result new file mode 100644 index 000000000..f15e2401d --- /dev/null +++ b/regress/screen-redraw-results/floating-noborder.result @@ -0,0 +1,12 @@ +base + + + NOBORDER + + + + + + + + diff --git a/regress/screen-redraw-results/floating-outside.result b/regress/screen-redraw-results/floating-outside.result new file mode 100644 index 000000000..f24f0f021 --- /dev/null +++ b/regress/screen-redraw-results/floating-outside.result @@ -0,0 +1,12 @@ +base │··········· + │··········· + │··········· + ┌──────────│··········· + │OUT │··········· + │ │··········· + │ │··········· + │ │··········· +────────────────────────────┘··········· +········································ +········································ +········································ diff --git a/regress/screen-redraw-results/floating-over-scrollbar.result b/regress/screen-redraw-results/floating-over-scrollbar.result new file mode 100644 index 000000000..80ecc8c30 --- /dev/null +++ b/regress/screen-redraw-results/floating-over-scrollbar.result @@ -0,0 +1,12 @@ +base  +  + ┌────────────────┐ + │OVERSB  │ + │  │ + │  │ + │  │ + │  │ + │  │ + └────────────────┘ +  +  diff --git a/regress/screen-redraw-results/floating-over-status.result b/regress/screen-redraw-results/floating-over-status.result new file mode 100644 index 000000000..76c6ebac9 --- /dev/null +++ b/regress/screen-redraw-results/floating-over-status.result @@ -0,0 +1,12 @@ +base + + + + + + ┌────────────────────┐ + │OVERST │ + │ │ + │ │ + │ │ + diff --git a/regress/screen-redraw-results/floating-over-tiled-double.result b/regress/screen-redraw-results/floating-over-tiled-double.result new file mode 100644 index 000000000..5e286a90f --- /dev/null +++ b/regress/screen-redraw-results/floating-over-tiled-double.result @@ -0,0 +1,12 @@ +TILE01 abcdefghij │TILE01 abcdefghij +TILE02 abcdefghij │TILE02 abcdefghij +TILE03 abc╔════════════════╗bcdefghij +TILE04 abc║FLT ║bcdefghij + ║ ║ +──────────║ ║──────────── +TILE00 abc║ ║bcdefghij +TILE01 abc║ ║bcdefghij +TILE02 abc║ ║bcdefghij +TILE03 abc╚════════════════╝bcdefghij +TILE04 abcdefghij │TILE04 abcdefghij + │ diff --git a/regress/screen-redraw-results/floating-over-tiled.result b/regress/screen-redraw-results/floating-over-tiled.result new file mode 100644 index 000000000..4332c27c0 --- /dev/null +++ b/regress/screen-redraw-results/floating-over-tiled.result @@ -0,0 +1,12 @@ +TILE01 abcdefghij │TILE01 abcdefghij +TILE02 abcdefghij │TILE02 abcdefghij +TILE03 abc┌────────────────┐bcdefghij +TILE04 abc│FLT │bcdefghij + │ │ +──────────│ │──────────── +TILE00 abc│ │bcdefghij +TILE01 abc│ │bcdefghij +TILE02 abc│ │bcdefghij +TILE03 abc└────────────────┘bcdefghij +TILE04 abcdefghij │TILE04 abcdefghij + │ diff --git a/regress/screen-redraw-results/floating-overlap.result b/regress/screen-redraw-results/floating-overlap.result new file mode 100644 index 000000000..58f00b60f --- /dev/null +++ b/regress/screen-redraw-results/floating-overlap.result @@ -0,0 +1,12 @@ +base + ┌────────────────┐ + │AAA │ + │ │ + │ │ + │ ┌────────────────┐ + │ │BBB │ + │ │ │ + └─────────│ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/floating-title.result b/regress/screen-redraw-results/floating-title.result new file mode 100644 index 000000000..896a715bf --- /dev/null +++ b/regress/screen-redraw-results/floating-title.result @@ -0,0 +1,12 @@ +── base ──────────────────────────────── +base ┌── title ───────────┐ + │FLOAT │ + │ │ + │ │ + │ │ + │ │ + │ │ + └────────────────────┘ + + + diff --git a/regress/screen-redraw-results/indicators-both.result b/regress/screen-redraw-results/indicators-both.result new file mode 100644 index 000000000..4c9e76e72 --- /dev/null +++ b/regress/screen-redraw-results/indicators-both.result @@ -0,0 +1,12 @@ + │ + ← + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/marked-pane-float.result b/regress/screen-redraw-results/marked-pane-float.result new file mode 100644 index 000000000..2be62da79 --- /dev/null +++ b/regress/screen-redraw-results/marked-pane-float.result @@ -0,0 +1,12 @@ + + + ┌────────────────────┐ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + └────────────────────┘ + + diff --git a/regress/screen-redraw-results/marked-pane-lr.result b/regress/screen-redraw-results/marked-pane-lr.result new file mode 100644 index 000000000..842f95c39 --- /dev/null +++ b/regress/screen-redraw-results/marked-pane-lr.result @@ -0,0 +1,12 @@ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/marked-pane-status.result b/regress/screen-redraw-results/marked-pane-status.result new file mode 100644 index 000000000..2e9830d21 --- /dev/null +++ b/regress/screen-redraw-results/marked-pane-status.result @@ -0,0 +1,12 @@ +── 0:left ──────────┬── 1:right ──────── + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/marked-pane-tb.result b/regress/screen-redraw-results/marked-pane-tb.result new file mode 100644 index 000000000..86181f199 --- /dev/null +++ b/regress/screen-redraw-results/marked-pane-tb.result @@ -0,0 +1,12 @@ + + + + + + +──────────────────────────────────────── + + + + + diff --git a/regress/screen-redraw-results/marked-pane-three.result b/regress/screen-redraw-results/marked-pane-three.result new file mode 100644 index 000000000..3f4f671ec --- /dev/null +++ b/regress/screen-redraw-results/marked-pane-three.result @@ -0,0 +1,12 @@ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/outside-both-2x2.result b/regress/screen-redraw-results/outside-both-2x2.result new file mode 100644 index 000000000..18644f952 --- /dev/null +++ b/regress/screen-redraw-results/outside-both-2x2.result @@ -0,0 +1,14 @@ +hij │ij │··········· +OUT07 abcdefg│PAN07 abcdefgh│··········· +hij │ij │··········· + │ │··········· +─────────────┼──────────────┤··········· +hij │ij │··········· +PAN07 abcdefg│PAN07 abcdefgh│··········· +hij │ij │··········· + │ │··········· +─────────────┴──────────────┘··········· +········································ +········································ +········································ +········································ diff --git a/regress/screen-redraw-results/outside-bottom-split.result b/regress/screen-redraw-results/outside-bottom-split.result new file mode 100644 index 000000000..fe68489da --- /dev/null +++ b/regress/screen-redraw-results/outside-bottom-split.result @@ -0,0 +1,14 @@ +OUT05 abcdefghij +OUT06 abcdefghij +OUT07 abcdefghij + +──────────────────────────────────────── +PAN05 abcdefghij +PAN06 abcdefghij +PAN07 abcdefghij + +──────────────────────────────────────── +········································ +········································ +········································ +········································ diff --git a/regress/screen-redraw-results/outside-right-single.result b/regress/screen-redraw-results/outside-right-single.result new file mode 100644 index 000000000..1aed39fd4 --- /dev/null +++ b/regress/screen-redraw-results/outside-right-single.result @@ -0,0 +1,14 @@ +OUT00 abcdefghij │··········· +OUT01 abcdefghij │··········· +OUT02 abcdefghij │··········· +OUT03 abcdefghij │··········· +OUT04 abcdefghij │··········· +OUT05 abcdefghij │··········· +OUT06 abcdefghij │··········· +OUT07 abcdefghij │··········· +OUT08 abcdefghij │··········· +OUT09 abcdefghij │··········· +OUT10 abcdefghij │··········· +OUT11 abcdefghij │··········· +OUT12 abcdefghij │··········· + │··········· diff --git a/regress/screen-redraw-results/outside-right-split.result b/regress/screen-redraw-results/outside-right-split.result new file mode 100644 index 000000000..c115e708c --- /dev/null +++ b/regress/screen-redraw-results/outside-right-split.result @@ -0,0 +1,14 @@ +ij │hij │··········· +OUT07 abcdefgh│PAN02 abcdefg│··········· +ij │hij │··········· +OUT08 abcdefgh│PAN03 abcdefg│··········· +ij │hij │··········· +OUT09 abcdefgh│PAN04 abcdefg│··········· +ij │hij │··········· +OUT10 abcdefgh│PAN05 abcdefg│··········· +ij │hij │··········· +OUT11 abcdefgh│PAN06 abcdefg│··········· +ij │hij │··········· +OUT12 abcdefgh│PAN07 abcdefg│··········· +ij │hij │··········· + │ │··········· diff --git a/regress/screen-redraw-results/pane-status-2x2-top.result b/regress/screen-redraw-results/pane-status-2x2-top.result new file mode 100644 index 000000000..14f8dc0be --- /dev/null +++ b/regress/screen-redraw-results/pane-status-2x2-top.result @@ -0,0 +1,14 @@ +── p0 ─────────────┬── p1 ────────────── + │ + │ + │ + │ + │ +── p2 ─────────────┼── p3 ────────────── + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/pane-status-3-bottom.result b/regress/screen-redraw-results/pane-status-3-bottom.result new file mode 100644 index 000000000..a0e3dc033 --- /dev/null +++ b/regress/screen-redraw-results/pane-status-3-bottom.result @@ -0,0 +1,14 @@ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ +── p0 ────┴── p1 ───┴── p2 ───────────── diff --git a/regress/screen-redraw-results/pane-status-3-top.result b/regress/screen-redraw-results/pane-status-3-top.result new file mode 100644 index 000000000..ce3808e08 --- /dev/null +++ b/regress/screen-redraw-results/pane-status-3-top.result @@ -0,0 +1,14 @@ +── p0 ────┬── p1 ───┬── p2 ───────────── + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/pane-status-bottom.result b/regress/screen-redraw-results/pane-status-bottom.result new file mode 100644 index 000000000..c848089fe --- /dev/null +++ b/regress/screen-redraw-results/pane-status-bottom.result @@ -0,0 +1,14 @@ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ +── 0:left ──────────┴── 1:right ──────── diff --git a/regress/screen-redraw-results/pane-status-top.result b/regress/screen-redraw-results/pane-status-top.result new file mode 100644 index 000000000..a1145d6e6 --- /dev/null +++ b/regress/screen-redraw-results/pane-status-top.result @@ -0,0 +1,14 @@ +── 0:left ──────────┬── 1:right ──────── + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/popup-basic.result b/regress/screen-redraw-results/popup-basic.result new file mode 100644 index 000000000..7b05d3a61 --- /dev/null +++ b/regress/screen-redraw-results/popup-basic.result @@ -0,0 +1,14 @@ +POP00 ┌──────────────────┐ +POP01 │POPUP │ +POP02 │ │ +POP03 │ │ +POP04 │ │ +POP05 └──────────────────┘ +POP06 abcdefghij +POP07 abcdefghij +POP08 abcdefghij +POP09 abcdefghij +POP10 abcdefghij +POP11 abcdefghij +POP12 abcdefghij + diff --git a/regress/screen-redraw-results/popup-double.result b/regress/screen-redraw-results/popup-double.result new file mode 100644 index 000000000..70b38c8c3 --- /dev/null +++ b/regress/screen-redraw-results/popup-double.result @@ -0,0 +1,14 @@ +POP00 ╔══════════════════╗ +POP01 ║POPUP ║ +POP02 ║ ║ +POP03 ║ ║ +POP04 ║ ║ +POP05 ╚══════════════════╝ +POP06 abcdefghij +POP07 abcdefghij +POP08 abcdefghij +POP09 abcdefghij +POP10 abcdefghij +POP11 abcdefghij +POP12 abcdefghij + diff --git a/regress/screen-redraw-results/popup-noborder.result b/regress/screen-redraw-results/popup-noborder.result new file mode 100644 index 000000000..fc641e781 --- /dev/null +++ b/regress/screen-redraw-results/popup-noborder.result @@ -0,0 +1,14 @@ +POP00 POPUP +POP01 +POP02 +POP03 +POP04 +POP05 +POP06 abcdefghij +POP07 abcdefghij +POP08 abcdefghij +POP09 abcdefghij +POP10 abcdefghij +POP11 abcdefghij +POP12 abcdefghij + diff --git a/regress/screen-redraw-results/popup-over-split.result b/regress/screen-redraw-results/popup-over-split.result new file mode 100644 index 000000000..558efc92e --- /dev/null +++ b/regress/screen-redraw-results/popup-over-split.result @@ -0,0 +1,14 @@ +POP00 ab┌──────────────────────┐fghij +POP01 ab│POPUP │fghij +POP02 ab│ │fghij +POP03 ab│ │fghij +POP04 ab│ │fghij +POP05 ab│ │fghij +POP06 ab│ │fghij +POP07 ab└──────────────────────┘fghij +POP08 abcdefghij │POP08 abcdefghij +POP09 abcdefghij │POP09 abcdefghij +POP10 abcdefghij │POP10 abcdefghij +POP11 abcdefghij │POP11 abcdefghij +POP12 abcdefghij │POP12 abcdefghij + │ diff --git a/regress/screen-redraw-results/scrollbar-copy-mode.result b/regress/screen-redraw-results/scrollbar-copy-mode.result new file mode 100644 index 000000000..864d138fa --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-copy-mode.result @@ -0,0 +1,12 @@ +1  +2  +3  +4  +5  +6  +7  +8  +9  +10  +11  +12  diff --git a/regress/screen-redraw-results/scrollbar-floating.result b/regress/screen-redraw-results/scrollbar-floating.result new file mode 100644 index 000000000..9ed4caff1 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-floating.result @@ -0,0 +1,12 @@ +SB00 abcdefghij  +SB01 abcdefghij  +SB02 ab┌────────────────────┐  +SB03 ab│FLOAT00 abcdef  │  +SB04 ab│FLOAT01 abcdef  │  +SB05 ab│FLOAT02 abcdef  │  +SB06 ab│FLOAT03 abcdef  │  +SB07 ab│FLOAT04 abcdef  │  +SB08 ab│  │  +SB09 ab└────────────────────┘  +SB10 abcdefghij  +  diff --git a/regress/screen-redraw-results/scrollbar-left-pad.result b/regress/screen-redraw-results/scrollbar-left-pad.result new file mode 100644 index 000000000..fbc0f8920 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-left-pad.result @@ -0,0 +1,12 @@ +  SB00 abcdefghij +  SB01 abcdefghij +  SB02 abcdefghij +  SB03 abcdefghij +  SB04 abcdefghij +  SB05 abcdefghij +  SB06 abcdefghij +  SB07 abcdefghij +  SB08 abcdefghij +  SB09 abcdefghij +  SB10 abcdefghij +  diff --git a/regress/screen-redraw-results/scrollbar-left-w1.result b/regress/screen-redraw-results/scrollbar-left-w1.result new file mode 100644 index 000000000..e09becffe --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-left-w1.result @@ -0,0 +1,12 @@ + SB00 abcdefghij + SB01 abcdefghij + SB02 abcdefghij + SB03 abcdefghij + SB04 abcdefghij + SB05 abcdefghij + SB06 abcdefghij + SB07 abcdefghij + SB08 abcdefghij + SB09 abcdefghij + SB10 abcdefghij +  diff --git a/regress/screen-redraw-results/scrollbar-right-pad.result b/regress/screen-redraw-results/scrollbar-right-pad.result new file mode 100644 index 000000000..ef9d6db47 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-right-pad.result @@ -0,0 +1,12 @@ +SB00 abcdefghij  +SB01 abcdefghij  +SB02 abcdefghij  +SB03 abcdefghij  +SB04 abcdefghij  +SB05 abcdefghij  +SB06 abcdefghij  +SB07 abcdefghij  +SB08 abcdefghij  +SB09 abcdefghij  +SB10 abcdefghij  +  diff --git a/regress/screen-redraw-results/scrollbar-right-w1.result b/regress/screen-redraw-results/scrollbar-right-w1.result new file mode 100644 index 000000000..ef9d6db47 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-right-w1.result @@ -0,0 +1,12 @@ +SB00 abcdefghij  +SB01 abcdefghij  +SB02 abcdefghij  +SB03 abcdefghij  +SB04 abcdefghij  +SB05 abcdefghij  +SB06 abcdefghij  +SB07 abcdefghij  +SB08 abcdefghij  +SB09 abcdefghij  +SB10 abcdefghij  +  diff --git a/regress/screen-redraw-results/scrollbar-right-w2.result b/regress/screen-redraw-results/scrollbar-right-w2.result new file mode 100644 index 000000000..3ccb8fe73 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-right-w2.result @@ -0,0 +1,12 @@ +SB00 abcdefghij  +SB01 abcdefghij  +SB02 abcdefghij  +SB03 abcdefghij  +SB04 abcdefghij  +SB05 abcdefghij  +SB06 abcdefghij  +SB07 abcdefghij  +SB08 abcdefghij  +SB09 abcdefghij  +SB10 abcdefghij  +  diff --git a/regress/screen-redraw-results/scrollbar-split-left.result b/regress/screen-redraw-results/scrollbar-split-left.result new file mode 100644 index 000000000..23938119f --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-split-left.result @@ -0,0 +1,12 @@ + SB00 abcdefghij │ SBL00 abcdefghij + SB01 abcdefghij │ SBL01 abcdefghij + SB02 abcdefghij │ SBL02 abcdefghij + SB03 abcdefghij │ SBL03 abcdefghij + SB04 abcdefghij │ SBL04 abcdefghij + SB05 abcdefghij │ SBL05 abcdefghij + SB06 abcdefghij │ SBL06 abcdefghij + SB07 abcdefghij │ SBL07 abcdefghij + SB08 abcdefghij │ SBL08 abcdefghij + SB09 abcdefghij │ SBL09 abcdefghij + SB10 abcdefghij │ SBL10 abcdefghij +  │  diff --git a/regress/screen-redraw-results/scrollbar-split-right.result b/regress/screen-redraw-results/scrollbar-split-right.result new file mode 100644 index 000000000..ab6184619 --- /dev/null +++ b/regress/screen-redraw-results/scrollbar-split-right.result @@ -0,0 +1,12 @@ +SB00 abcdefghij  │SBR00 abcdefghij  +SB01 abcdefghij  │SBR01 abcdefghij  +SB02 abcdefghij  │SBR02 abcdefghij  +SB03 abcdefghij  │SBR03 abcdefghij  +SB04 abcdefghij  │SBR04 abcdefghij  +SB05 abcdefghij  │SBR05 abcdefghij  +SB06 abcdefghij  │SBR06 abcdefghij  +SB07 abcdefghij  │SBR07 abcdefghij  +SB08 abcdefghij  │SBR08 abcdefghij  +SB09 abcdefghij  │SBR09 abcdefghij  +SB10 abcdefghij  │SBR10 abcdefghij  +  │  diff --git a/regress/screen-redraw-results/status-3-bottom.result b/regress/screen-redraw-results/status-3-bottom.result new file mode 100644 index 000000000..1a62240d0 --- /dev/null +++ b/regress/screen-redraw-results/status-3-bottom.result @@ -0,0 +1,12 @@ +TOP + + + +────────────────────────────── +BOT + + + + + + diff --git a/regress/screen-redraw-results/status-3-top.result b/regress/screen-redraw-results/status-3-top.result new file mode 100644 index 000000000..8b8d02742 --- /dev/null +++ b/regress/screen-redraw-results/status-3-top.result @@ -0,0 +1,12 @@ + + + +TOP + + + +────────────────────────────── +BOT + + + diff --git a/regress/screen-redraw-results/status-bottom.result b/regress/screen-redraw-results/status-bottom.result new file mode 100644 index 000000000..47979559d --- /dev/null +++ b/regress/screen-redraw-results/status-bottom.result @@ -0,0 +1,12 @@ +TOP + + + + +────────────────────────────── +BOT + + + + + diff --git a/regress/screen-redraw-results/status-off.result b/regress/screen-redraw-results/status-off.result new file mode 100644 index 000000000..e56d82be4 --- /dev/null +++ b/regress/screen-redraw-results/status-off.result @@ -0,0 +1,12 @@ +TOP + + + + + +────────────────────────────── +BOT + + + + diff --git a/regress/screen-redraw-results/status-top.result b/regress/screen-redraw-results/status-top.result new file mode 100644 index 000000000..e06a06793 --- /dev/null +++ b/regress/screen-redraw-results/status-top.result @@ -0,0 +1,12 @@ + +TOP + + + + +────────────────────────────── +BOT + + + + diff --git a/regress/screen-redraw-results/tee-down-double.result b/regress/screen-redraw-results/tee-down-double.result new file mode 100644 index 000000000..f67bb874d --- /dev/null +++ b/regress/screen-redraw-results/tee-down-double.result @@ -0,0 +1,14 @@ + + + + + + + +════════════════════╦═══════════════════ + ║ + ║ + ║ + ║ + ║ + ║ diff --git a/regress/screen-redraw-results/tee-down-heavy.result b/regress/screen-redraw-results/tee-down-heavy.result new file mode 100644 index 000000000..19bbdeb1a --- /dev/null +++ b/regress/screen-redraw-results/tee-down-heavy.result @@ -0,0 +1,14 @@ + + + + + + + +━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ diff --git a/regress/screen-redraw-results/tee-down-none.result b/regress/screen-redraw-results/tee-down-none.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-down-none.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/tee-down-number.result b/regress/screen-redraw-results/tee-down-number.result new file mode 100644 index 000000000..3081640b8 --- /dev/null +++ b/regress/screen-redraw-results/tee-down-number.result @@ -0,0 +1,14 @@ + + + + + + + +0000000000000000000022222222222222222222 + 2 + 2 + 2 + 2 + 2 + 2 diff --git a/regress/screen-redraw-results/tee-down-simple.result b/regress/screen-redraw-results/tee-down-simple.result new file mode 100644 index 000000000..5c68949e3 --- /dev/null +++ b/regress/screen-redraw-results/tee-down-simple.result @@ -0,0 +1,14 @@ + + + + + + + +--------------------+------------------- + | + | + | + | + | + | diff --git a/regress/screen-redraw-results/tee-down-single.result b/regress/screen-redraw-results/tee-down-single.result new file mode 100644 index 000000000..405ec7f61 --- /dev/null +++ b/regress/screen-redraw-results/tee-down-single.result @@ -0,0 +1,14 @@ + + + + + + + +────────────────────┬─────────────────── + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/tee-down-spaces.result b/regress/screen-redraw-results/tee-down-spaces.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-down-spaces.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/tee-lr-double.result b/regress/screen-redraw-results/tee-lr-double.result new file mode 100644 index 000000000..422c21365 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-double.result @@ -0,0 +1,14 @@ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ╠═════════╣ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ + ║ ║ diff --git a/regress/screen-redraw-results/tee-lr-heavy.result b/regress/screen-redraw-results/tee-lr-heavy.result new file mode 100644 index 000000000..708453bcf --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-heavy.result @@ -0,0 +1,14 @@ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┣━━━━━━━━━┫ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ + ┃ ┃ diff --git a/regress/screen-redraw-results/tee-lr-none.result b/regress/screen-redraw-results/tee-lr-none.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-none.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/tee-lr-number.result b/regress/screen-redraw-results/tee-lr-number.result new file mode 100644 index 000000000..9595d0481 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-number.result @@ -0,0 +1,14 @@ + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 22222222222 + 2 2 + 2 2 + 2 2 + 2 2 + 2 2 + 2 2 diff --git a/regress/screen-redraw-results/tee-lr-simple.result b/regress/screen-redraw-results/tee-lr-simple.result new file mode 100644 index 000000000..73fb7f599 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-simple.result @@ -0,0 +1,14 @@ + | | + | | + | | + | | + | | + | | + | | + +---------+ + | | + | | + | | + | | + | | + | | diff --git a/regress/screen-redraw-results/tee-lr-single.result b/regress/screen-redraw-results/tee-lr-single.result new file mode 100644 index 000000000..4f8645ab5 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-single.result @@ -0,0 +1,14 @@ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + ├─────────┤ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ diff --git a/regress/screen-redraw-results/tee-lr-spaces.result b/regress/screen-redraw-results/tee-lr-spaces.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-lr-spaces.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/tee-up-double.result b/regress/screen-redraw-results/tee-up-double.result new file mode 100644 index 000000000..6df4582a4 --- /dev/null +++ b/regress/screen-redraw-results/tee-up-double.result @@ -0,0 +1,14 @@ + ║ + ║ + ║ + ║ + ║ + ║ + ║ +════════════════════╩═══════════════════ + + + + + + diff --git a/regress/screen-redraw-results/tee-up-heavy.result b/regress/screen-redraw-results/tee-up-heavy.result new file mode 100644 index 000000000..1e7d96375 --- /dev/null +++ b/regress/screen-redraw-results/tee-up-heavy.result @@ -0,0 +1,14 @@ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ + ┃ +━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━ + + + + + + diff --git a/regress/screen-redraw-results/tee-up-none.result b/regress/screen-redraw-results/tee-up-none.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-up-none.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/tee-up-number.result b/regress/screen-redraw-results/tee-up-number.result new file mode 100644 index 000000000..894341213 --- /dev/null +++ b/regress/screen-redraw-results/tee-up-number.result @@ -0,0 +1,14 @@ + 1 + 1 + 1 + 1 + 1 + 1 + 1 +0000000000000000000011111111111111111111 + + + + + + diff --git a/regress/screen-redraw-results/tee-up-simple.result b/regress/screen-redraw-results/tee-up-simple.result new file mode 100644 index 000000000..5cf438f5a --- /dev/null +++ b/regress/screen-redraw-results/tee-up-simple.result @@ -0,0 +1,14 @@ + | + | + | + | + | + | + | +--------------------+------------------- + + + + + + diff --git a/regress/screen-redraw-results/tee-up-single.result b/regress/screen-redraw-results/tee-up-single.result new file mode 100644 index 000000000..1f94c93ba --- /dev/null +++ b/regress/screen-redraw-results/tee-up-single.result @@ -0,0 +1,14 @@ + │ + │ + │ + │ + │ + │ + │ +────────────────────┴─────────────────── + + + + + + diff --git a/regress/screen-redraw-results/tee-up-spaces.result b/regress/screen-redraw-results/tee-up-spaces.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/tee-up-spaces.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-results/two-pane-colour-horizontal.result b/regress/screen-redraw-results/two-pane-colour-horizontal.result new file mode 100644 index 000000000..6d4e431d9 --- /dev/null +++ b/regress/screen-redraw-results/two-pane-colour-horizontal.result @@ -0,0 +1,12 @@ + + + + + + +──────────────────────────────────────── + + + + + diff --git a/regress/screen-redraw-results/two-pane-colour-vertical.result b/regress/screen-redraw-results/two-pane-colour-vertical.result new file mode 100644 index 000000000..6beaf0200 --- /dev/null +++ b/regress/screen-redraw-results/two-pane-colour-vertical.result @@ -0,0 +1,12 @@ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ + │ diff --git a/regress/screen-redraw-results/window-style-active.result b/regress/screen-redraw-results/window-style-active.result new file mode 100644 index 000000000..e32cc31ca --- /dev/null +++ b/regress/screen-redraw-results/window-style-active.result @@ -0,0 +1,8 @@ +STYLE00 abcdefghij │STYLE00 abcdefghij +STYLE01 abcdefghij │STYLE01 abcdefghij +STYLE02 abcdefghij │STYLE02 abcdefghij +STYLE03 abcdefghij │STYLE03 abcdefghij +STYLE04 abcdefghij │STYLE04 abcdefghij +STYLE05 abcdefghij │STYLE05 abcdefghij +STYLE06 abcdefghij │STYLE06 abcdefghij + │ diff --git a/regress/screen-redraw-results/window-style-single.result b/regress/screen-redraw-results/window-style-single.result new file mode 100644 index 000000000..3895c6f31 --- /dev/null +++ b/regress/screen-redraw-results/window-style-single.result @@ -0,0 +1,8 @@ +STYLE00 abcdefghij +STYLE01 abcdefghij +STYLE02 abcdefghij +STYLE03 abcdefghij +STYLE04 abcdefghij +STYLE05 abcdefghij +STYLE06 abcdefghij + diff --git a/regress/screen-redraw-results/zoomed-pane.result b/regress/screen-redraw-results/zoomed-pane.result new file mode 100644 index 000000000..5cf5d3dc4 --- /dev/null +++ b/regress/screen-redraw-results/zoomed-pane.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/regress/screen-redraw-scrollbars.sh b/regress/screen-redraw-scrollbars.sh new file mode 100644 index 000000000..f8298b5e1 --- /dev/null +++ b/regress/screen-redraw-scrollbars.sh @@ -0,0 +1,142 @@ +#!/bin/sh + +# Exercise screen-redraw.c drawing of pane scrollbars: position (right/left), +# width, and pad (which is handled separately from width). Scrollbars are drawn +# as styled (coloured) cells rather than glyphs, so these scenes are captured +# with escape sequences (-e); without that the scrollbar is invisible. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer pane is captured and compared with a golden in screen_redraw_results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +# compare : capture the outer pane with escapes and compare (or generate). +compare() { + sleep 1 + $TMUX capturep -pe >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +# new_scene: fresh inner window, single full-size pane. +new_scene() { + $TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 11 ]; do printf \"SB%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y12 || exit 1 +} + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y12 "sh -c 'i=0; while [ \$i -lt 11 ]; do printf \"SB%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 +$TMUX2 set -g pane-scrollbars on || exit 1 + +$TMUX new -d -x40 -y12 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Right, width 1, no pad. +new_scene +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +compare scrollbar-right-w1 + +# Left, width 1, no pad. +new_scene +$TMUX2 setw pane-scrollbars-position left || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +compare scrollbar-left-w1 + +# Right, width 2, no pad. +new_scene +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=2,pad=0" || exit 1 +compare scrollbar-right-w2 + +# Right, width 1, pad 1. The pad is drawn between the pane content and the +# scrollbar; for a right scrollbar that pad cell is at the right edge, so capture +# trims it and this matches scrollbar-right-w1. The golden still pins that +# behaviour (and the pad draw path runs); the left scene below shows pad visibly. +new_scene +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=1" || exit 1 +compare scrollbar-right-pad + +# Left, width 1, pad 1: the pad cell sits between the slider and the content, so +# it is visible (one extra column before the pane content). +new_scene +$TMUX2 setw pane-scrollbars-position left || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=1" || exit 1 +compare scrollbar-left-pad + +# Floating pane with a scrollbar. +new_scene +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +$TMUX2 new-pane -x20 -y6 -X8 -Y3 "sh -c 'i=0; while [ \$i -lt 5 ]; do printf \"FLOAT%02d abcdef\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +compare scrollbar-floating + +# Two tiled panes side by side, each with a right scrollbar. The left pane's +# scrollbar sits between its content and the shared border, so the border is +# extended outward over the scrollbar gap (the right += sb_w path in +# redraw_mark_pane_borders) and must still join cleanly. The right pane's +# scrollbar abuts the window edge. +new_scene +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +$TMUX2 splitw -h "sh -c 'i=0; while [ \$i -lt 11 ]; do printf \"SBR%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare scrollbar-split-right + +# Same split with the scrollbars on the left: the right pane's scrollbar now sits +# between the shared border and its content (the left -= sb_w path). +new_scene +$TMUX2 setw pane-scrollbars-position left || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +$TMUX2 splitw -h "sh -c 'i=0; while [ \$i -lt 11 ]; do printf \"SBL%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare scrollbar-split-left + +# Scrollbar slider in copy mode: with scrollback the slider is shorter than the +# track, so this exercises the slider geometry (which only runs when the pane is +# in a mode). copy-mode -H hides the position indicator, which is not stable. +$TMUX2 neww -d "sh -c 'seq 40; exec sleep 100'" || exit 1 +$TMUX2 selectw -t:\$ || exit 1 +$TMUX2 resizew -x40 -y12 || exit 1 +$TMUX2 setw pane-scrollbars-position right || exit 1 +$TMUX2 setw pane-scrollbars-style "bg=black,fg=white,width=1,pad=0" || exit 1 +$TMUX2 copy-mode -H || exit 1 +$TMUX2 send -X history-top || exit 1 +compare scrollbar-copy-mode -e + +exit 0 diff --git a/regress/screen-redraw-status.sh b/regress/screen-redraw-status.sh new file mode 100644 index 000000000..12ca20bb1 --- /dev/null +++ b/regress/screen-redraw-status.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# Exercise how the client status line affects the window scene drawn by +# screen-redraw.c. The status line is not part of the scene, but its size and +# position change the scene's offset and height (status_line_size and the +# REDRAW_STATUS_TOP flag in screen-redraw.c). The status line content does not +# matter, so status-format is set empty; only the offset effect is tested. +# +# A top/bottom split makes the offset visible: the horizontal border and the +# pane contents move as the status line grows or changes side. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer pane is captured and compared with a golden in screen-redraw-results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +# Inner: a top/bottom split. The window tracks the attached client size, so the +# status line shrinks/shifts the window scene. Status content is blanked. +$TMUX2 new -d -x30 -y12 "sh -c 'printf TOP; exec sleep 100'" || exit 1 +$TMUX2 set -g window-size latest || exit 1 +i=0 +while [ $i -le 4 ]; do + $TMUX2 set -g status-format[$i] "" || exit 1 + i=$((i + 1)) +done +$TMUX2 splitw -v "sh -c 'printf BOT; exec sleep 100'" || exit 1 + +$TMUX new -d -x30 -y12 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# No status line: the window fills the whole client. +$TMUX2 set -g status off || exit 1 +compare status-off + +# One line at the bottom: the scene loses its bottom row. +$TMUX2 set -g status on || exit 1 +$TMUX2 set -g status-position bottom || exit 1 +compare status-bottom + +# One line at the top: the whole scene is shifted down one row. +$TMUX2 set -g status-position top || exit 1 +compare status-top + +# Three lines at the bottom. +$TMUX2 set -g status 3 || exit 1 +$TMUX2 set -g status-position bottom || exit 1 +compare status-3-bottom + +# Three lines at the top: the scene is shifted down three rows. +$TMUX2 set -g status-position top || exit 1 +compare status-3-top + +exit 0 diff --git a/regress/screen-redraw-tiled.sh b/regress/screen-redraw-tiled.sh new file mode 100644 index 000000000..94353f5f8 --- /dev/null +++ b/regress/screen-redraw-tiled.sh @@ -0,0 +1,191 @@ +#!/bin/sh + +# Exercise screen-redraw.c border drawing for non-floating (tiled) panes: the +# border junctions where panes meet, and pane status lines/titles. +# +# Four layouts cover every junction type that tiled panes produce: +# cross - a 2x2 grid: a full crossing (+ / CELL_LRUD) +# tee-lr - three columns with the middle split: left and right tees +# (|- and -| / URD, ULD) +# tee-up - a top/bottom split with the top split: a bottom tee (_|_ / LRU) +# tee-down - a top/bottom split with the bottom split: a top tee (T / LRD) +# Each layout is rendered once for every value of pane-border-lines, so every +# junction is checked in every border style. One layout per result file. +# +# Each scene is rendered in an inner tmux attached inside an outer tmux pane. +# The outer pane is captured (the full client scene drawn by screen-redraw.c) +# and compared with a golden file in screen-redraw-results/. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -p >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +# Fresh inner window of fixed size, with one command running. +new_scene() { + $TMUX2 selectw -t:0 || exit 1 + $TMUX2 kill-window -a 2>/dev/null + $TMUX2 neww -d "sh -c 'exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y14 || exit 1 +} + +C="sh -c 'exec sleep 100'" + +# Layouts. Each produces one kind of junction. Splits at fixed window size are +# deterministic. +layout_cross() { # 2x2 grid: a full crossing + new_scene + $TMUX2 splitw -h "$C" || exit 1 + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 selectp -t0 || exit 1 + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 select-layout tiled || exit 1 +} +layout_tee_lr() { # three columns, middle split: left and right tees + new_scene + $TMUX2 splitw -h "$C" || exit 1 + $TMUX2 selectp -t0 || exit 1 + $TMUX2 splitw -h "$C" || exit 1 + $TMUX2 selectp -t1 || exit 1 + $TMUX2 splitw -v "$C" || exit 1 +} +layout_tee_up() { # top/bottom, top split: a bottom tee + new_scene + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 selectp -t0 || exit 1 + $TMUX2 splitw -h "$C" || exit 1 +} +layout_tee_down() { # top/bottom, bottom split: a top tee + new_scene + $TMUX2 splitw -v "$C" || exit 1 + $TMUX2 selectp -t1 || exit 1 + $TMUX2 splitw -h "$C" || exit 1 +} + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y14 "sh -c 'exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 +$TMUX2 set -g pane-border-format " #{pane_index} " || exit 1 + +$TMUX new -d -x40 -y14 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Every junction in every border style. New windows inherit the global option, +# so set it before building each layout. +for style in single double heavy simple number spaces none; do + $TMUX2 set -g pane-border-lines $style || exit 1 + layout_cross; compare cross-$style + layout_tee_lr; compare tee-lr-$style + layout_tee_up; compare tee-up-$style + layout_tee_down; compare tee-down-$style +done +$TMUX2 set -g pane-border-lines single || exit 1 + +# Pane status lines and titles (one layout each). Use a format that includes the +# explicitly-set title; the default title is the hostname, which is not stable, +# so every pane's title must be set. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 setw pane-border-format " #{pane_index}:#{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +$TMUX2 selectp -t:.0 -T left || exit 1 +$TMUX2 selectp -t:.1 -T right || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare pane-status-top + +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 setw pane-border-format " #{pane_index}:#{pane_title} " || exit 1 +$TMUX2 setw pane-border-status bottom || exit 1 +$TMUX2 selectp -t:.0 -T left || exit 1 +$TMUX2 selectp -t:.1 -T right || exit 1 +$TMUX2 selectp -t:.0 || exit 1 +compare pane-status-bottom + +# title_all : set every pane's title (the default is the hostname). +title_all() { + for p in $($TMUX2 list-panes -F '#{pane_index}'); do + $TMUX2 selectp -t:.$p -T $1$p || exit 1 + done + $TMUX2 selectp -t:.0 || exit 1 +} + +# Three columns with a status line on top, then on the bottom. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +title_all p +compare pane-status-3-top + +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 setw pane-border-status bottom || exit 1 +title_all p +compare pane-status-3-bottom + +# A 2x2 grid with a status line on top: status borders meet pane borders at the +# internal junctions. +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 select-layout tiled || exit 1 +$TMUX2 setw pane-border-format " #{pane_title} " || exit 1 +$TMUX2 setw pane-border-status top || exit 1 +title_all p +compare pane-status-2x2-top + +# A zoomed pane: the active pane fills the whole window and the other panes and +# their borders are not drawn at all (a single full-window pane scene). +new_scene +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 splitw -v "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +$TMUX2 resize-pane -Z || exit 1 +compare zoomed-pane + +exit 0 diff --git a/regress/screen-redraw-window-style.sh b/regress/screen-redraw-window-style.sh new file mode 100644 index 000000000..1d2b2b281 --- /dev/null +++ b/regress/screen-redraw-window-style.sh @@ -0,0 +1,77 @@ +#!/bin/sh + +# Exercise window-style and window-active-style, which set the default cell +# (background) style for a window's panes. screen-redraw.c uses these for the +# default grid cell of each pane (the active pane uses window-active-style, the +# others window-style). Captured with -e to record the background colours. +# +# Run with GENERATE=1 to (re)create the golden files. + +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 -Ltest -f/dev/null" +TMUX2="$TEST_TMUX -Ltest2 -f/dev/null" +RESULTS=screen-redraw-results + +TMP=$(mktemp) +trap "rm -f $TMP; $TMUX kill-server 2>/dev/null; $TMUX2 kill-server 2>/dev/null" \ + 0 1 15 + +fail() { + echo "$*" >&2 + exit 1 +} + +compare() { + sleep 1 + $TMUX capturep -pe >$TMP || exit 1 + if [ -n "$GENERATE" ]; then + cp $TMP "$RESULTS/$1.result" || exit 1 + echo "generated $1" + else + cmp -s $TMP "$RESULTS/$1.result" || \ + fail "scene $1 differs from $RESULTS/$1.result" + fi +} + +new_scene() { + $TMUX2 neww -d "sh -c 'i=0; while [ \$i -lt 7 ]; do printf \"STYLE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 + $TMUX2 selectw -t:\$ || exit 1 + $TMUX2 resizew -x40 -y8 || exit 1 +} + +C="sh -c 'i=0; while [ \$i -lt 7 ]; do printf \"STYLE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" + +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null + +$TMUX2 new -d -x40 -y8 "sh -c 'i=0; while [ \$i -lt 7 ]; do printf \"STYLE%02d abcdefghij\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1 +$TMUX2 set -g status off || exit 1 +$TMUX2 set -g window-size manual || exit 1 + +$TMUX new -d -x40 -y8 || exit 1 +$TMUX set -g status off || exit 1 +$TMUX set -g window-size manual || exit 1 +$TMUX set -g default-terminal "tmux-256color" || exit 1 +$TMUX send -l "$TMUX2 attach" || exit 1 +$TMUX send Enter || exit 1 +sleep 1 + +# Single pane with a window background style. +new_scene +$TMUX2 setw window-style "bg=blue" || exit 1 +compare window-style-single + +# Split: the active pane uses window-active-style, the other window-style. +new_scene +$TMUX2 setw window-style "bg=blue" || exit 1 +$TMUX2 setw window-active-style "bg=red" || exit 1 +$TMUX2 splitw -h "$C" || exit 1 +$TMUX2 selectp -t0 || exit 1 +compare window-style-active + +exit 0