Merge branch 'obsd-master'
[tmux.git] / regress / if-shell-nested.sh
blob976c6738a6a617b35d3b517257f1e99af116dffc
1 #!/bin/sh
3 # 882
4 # tmux inside if-shell itself should work
6 PATH=/bin:/usr/bin
7 TERM=screen
9 [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
10 TMUX="$TEST_TMUX -Ltest"
11 $TMUX kill-server 2>/dev/null
13 TMP=$(mktemp)
14 trap "rm -f $TMP" 0 1 15
16 cat <<EOF >$TMP
17 if '$TMUX run "true"' 'set -s @done yes'
18 EOF
20 TERM=xterm $TMUX -f$TMP new -d "$TMUX show -vs @done >>$TMP" || exit 1
21 sleep 1 && [ "$(tail -1 $TMP)" = "yes" ] || exit 1
23 $TMUX has 2>/dev/null && exit 1
25 exit 0