Merge branch 'obsd-master'
[tmux.git] / regress / am-terminal.sh
blob940334681e9cacf8a8a7817cce4d2efe802e4514
1 #!/bin/sh
3 PATH=/bin:/usr/bin
4 TERM=screen
6 [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
7 TMUX="$TEST_TMUX -Ltest"
8 $TMUX kill-server 2>/dev/null
9 TMUX2="$TEST_TMUX -Ltest2"
10 $TMUX2 kill-server 2>/dev/null
12 TMP=$(mktemp)
13 trap "rm -f $TMP" 0 1 15
15 $TMUX2 -f/dev/null new -d || exit 1
16 $TMUX2 set -as terminal-overrides ',*:am@' || exit 1
17 $TMUX2 set -g status-right 'RRR' || exit 1
18 $TMUX2 set -g status-left 'LLL' || exit 1
19 $TMUX2 set -g window-status-current-format 'WWW' || exit 1
20 $TMUX -f/dev/null new -x20 -y2 -d "$TMUX2 attach" || exit 1
21 sleep 1
22 $TMUX capturep -p|tail -1 >$TMP || exit 1
23 $TMUX kill-server 2>/dev/null
24 $TMUX2 kill-server 2>/dev/null
25 cat <<EOF|cmp -s $TMP - || exit 1
26 LLLWWW RR
27 EOF
29 exit 0