summaryrefslogtreecommitdiffstats
path: root/regress/if-shell-nested.sh
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2017-04-25 14:30:58 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2017-04-25 14:30:58 +0100
commit45965fb020522896752d3d5e27dea2f062b45dba (patch)
tree0c8c13c5bdf46fd898a3c78f68c55e175d66998f /regress/if-shell-nested.sh
parent6ac39d5cdbd3c5910b622f58d9b6dd32e15098e2 (diff)
And another test.
Diffstat (limited to 'regress/if-shell-nested.sh')
-rw-r--r--regress/if-shell-nested.sh25
1 files changed, 25 insertions, 0 deletions
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 <<EOF >$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