mirror of
https://github.com/tmux/tmux.git
synced 2026-10-13 14:24:28 +00:00
macOS parallel issues.
This commit is contained in:
@@ -4,6 +4,9 @@ TERM=screen
|
|||||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||||
TMUX="$TEST_TMUX -LtestA$$ -f/dev/null"
|
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)
|
TMP=$(mktemp)
|
||||||
EXP=$(mktemp)
|
EXP=$(mktemp)
|
||||||
trap 'rm -f "$TMP" "$EXP"; $TMUX kill-server 2>/dev/null' 0 1 15
|
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
|
$TMUX kill-server 2>/dev/null
|
||||||
sleep 0.1
|
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 set-option -g history-limit "$hlimit" || exit 1
|
||||||
$TMUX new-session -d -x "$sx" -y "$sy" -s "$name" \
|
$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
|
$TMUX kill-session -t test-setup
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ $TMUX kill-server 2>/dev/null
|
|||||||
sleep 0.1
|
sleep 0.1
|
||||||
$TMUX new-session -d -x 5 -y 3 -s history \; \
|
$TMUX new-session -d -x 5 -y 3 -s history \; \
|
||||||
set-option -g history-limit 3 \; \
|
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
|
sleep 0.3
|
||||||
$TMUX capture-pane -pN -t history: -S - -E - | normalize_capture >"$TMP"
|
$TMUX capture-pane -pN -t history: -S - -E - | normalize_capture >"$TMP"
|
||||||
printf "%s\n" '01
|
printf "%s\n" '01
|
||||||
|
|||||||
@@ -22,14 +22,26 @@ check_directory()
|
|||||||
fi
|
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' \; \
|
$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"
|
check_directory "$TMP/first"
|
||||||
|
|
||||||
# An explicit target must supply the format context, including with a delay.
|
# An explicit target must supply the format context, including with a delay.
|
||||||
pane=$($TMUX new-window -d -P -F '#{pane_id}' -t test \
|
pane=$($TMUX new-window -d -P -F '#{pane_id}' -t test \
|
||||||
-c "$TMP/second dir" 'sleep 60') || exit 1
|
-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}' \
|
$TMUX run-shell -t "$pane" -d 0.1 -c '#{pane_current_path}' \
|
||||||
"pwd >'$TMP/out'" || exit 1
|
"pwd >'$TMP/out'" || exit 1
|
||||||
check_directory "$TMP/second dir"
|
check_directory "$TMP/second dir"
|
||||||
|
|||||||
Reference in New Issue
Block a user