From 6a8c21fb416d389f51b1d7f518d862b09936e7d8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 21 Sep 2026 22:27:43 +0100 Subject: [PATCH] macOS parallel issues. --- regress/input-common.inc | 7 +++++-- regress/input-scroll.sh | 2 +- regress/run-shell-cwd.sh | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/regress/input-common.inc b/regress/input-common.inc index ac04dbc24..a7ce572f6 100644 --- a/regress/input-common.inc +++ b/regress/input-common.inc @@ -4,6 +4,9 @@ TERM=screen [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) TMUX="$TEST_TMUX -LtestA$$ -f/dev/null" +# Keep panes alive until the next case or cleanup, without reading replies. +INPUT_HOLD='while :; do sleep 3600; done' + TMP=$(mktemp) EXP=$(mktemp) trap 'rm -f "$TMP" "$EXP"; $TMUX kill-server 2>/dev/null' 0 1 15 @@ -37,10 +40,10 @@ start_pane_hlimit() $TMUX kill-server 2>/dev/null sleep 0.1 - $TMUX new-session -d -x 1 -y 1 -s test-setup "sleep 2" || exit 1 + $TMUX new-session -d -x 1 -y 1 -s test-setup "$INPUT_HOLD" || exit 1 $TMUX set-option -g history-limit "$hlimit" || exit 1 $TMUX new-session -d -x "$sx" -y "$sy" -s "$name" \ - "printf '$seq'; sleep 2" || exit 1 + "printf '$seq'; $INPUT_HOLD" || exit 1 $TMUX kill-session -t test-setup sleep 0.3 } diff --git a/regress/input-scroll.sh b/regress/input-scroll.sh index 6ae48e96d..206c4db95 100644 --- a/regress/input-scroll.sh +++ b/regress/input-scroll.sh @@ -51,7 +51,7 @@ $TMUX kill-server 2>/dev/null sleep 0.1 $TMUX new-session -d -x 5 -y 3 -s history \; \ set-option -g history-limit 3 \; \ - respawn-pane -k "printf '01\n02\n03\n04\n05\n06'; sleep 2" || exit 1 + respawn-pane -k "printf '01\n02\n03\n04\n05\n06'; $INPUT_HOLD" || exit 1 sleep 0.3 $TMUX capture-pane -pN -t history: -S - -E - | normalize_capture >"$TMP" printf "%s\n" '01 diff --git a/regress/run-shell-cwd.sh b/regress/run-shell-cwd.sh index abcc89ee6..0371a43df 100644 --- a/regress/run-shell-cwd.sh +++ b/regress/run-shell-cwd.sh @@ -22,14 +22,26 @@ check_directory() fi } -# Expand the current pane's directory in the same command queue as creation. +# The start path is available immediately, before the child is scheduled. +# Use it to test the format context in the same command queue as creation. $TMUX new-session -d -s test -c "$TMP/first" 'sleep 60' \; \ - run-shell -c '#{pane_current_path}' "pwd >'$TMP/out'" || exit 1 + run-shell -c '#{pane_start_path}' "pwd >'$TMP/out'" || exit 1 check_directory "$TMP/first" # An explicit target must supply the format context, including with a delay. pane=$($TMUX new-window -d -P -F '#{pane_id}' -t test \ -c "$TMP/second dir" 'sleep 60') || exit 1 +# The current path depends on the operating system finding the child process. +i=0 +while [ "$($TMUX display-message -p -t "$pane" '#{pane_current_path}')" != \ + "$TMP/second dir" ]; do + if [ "$i" -ge 100 ]; then + echo "Timed out waiting for pane current directory" + exit 1 + fi + sleep 0.05 + i=$((i + 1)) +done $TMUX run-shell -t "$pane" -d 0.1 -c '#{pane_current_path}' \ "pwd >'$TMP/out'" || exit 1 check_directory "$TMP/second dir"