From 45965fb020522896752d3d5e27dea2f062b45dba Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 25 Apr 2017 14:30:58 +0100 Subject: [PATCH] And another test. --- regress/if-shell-TERM.sh | 2 +- regress/if-shell-error.sh | 2 +- regress/if-shell-nested.sh | 25 +++++++++++++++++++++++++ regress/new-session-no-client.sh | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 regress/if-shell-nested.sh diff --git a/regress/if-shell-TERM.sh b/regress/if-shell-TERM.sh index c29741ac..5967a58f 100644 --- a/regress/if-shell-TERM.sh +++ b/regress/if-shell-TERM.sh @@ -6,7 +6,7 @@ PATH=/bin:/usr/bin TERM=screen -[ -z "$TEST_TMUX" ] && TEST_TMUX=../tmux +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) TMUX="$TEST_TMUX -Ltest" $TMUX kill-server 2>/dev/null diff --git a/regress/if-shell-error.sh b/regress/if-shell-error.sh index 4477850c..24dc578e 100644 --- a/regress/if-shell-error.sh +++ b/regress/if-shell-error.sh @@ -6,7 +6,7 @@ PATH=/bin:/usr/bin TERM=screen -[ -z "$TEST_TMUX" ] && TEST_TMUX=../tmux +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) TMUX="$TEST_TMUX -Ltest" $TMUX kill-server 2>/dev/null diff --git a/regress/if-shell-nested.sh b/regress/if-shell-nested.sh new file mode 100644 index 00000000..976c6738 --- /dev/null +++ b/regress/if-shell-nested.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# 882 +# tmux inside if-shell itself should work + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +cat <$TMP +if '$TMUX run "true"' 'set -s @done yes' +EOF + +TERM=xterm $TMUX -f$TMP new -d "$TMUX show -vs @done >>$TMP" || exit 1 +sleep 1 && [ "$(tail -1 $TMP)" = "yes" ] || exit 1 + +$TMUX has 2>/dev/null && exit 1 + +exit 0 diff --git a/regress/new-session-no-client.sh b/regress/new-session-no-client.sh index 47e952b3..88c064cd 100644 --- a/regress/new-session-no-client.sh +++ b/regress/new-session-no-client.sh @@ -7,7 +7,7 @@ PATH=/bin:/usr/bin TERM=screen -[ -z "$TEST_TMUX" ] && TEST_TMUX=../tmux +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) TMUX="$TEST_TMUX -Ltest" $TMUX kill-server 2>/dev/null