Merge branch 'obsd-master'
[tmux.git] / regress / new-session-base-index.sh
blob337037c34781dbd7cc7eeac633e938e8ac23503d
1 #!/bin/sh
3 # new session base-index
5 PATH=/bin:/usr/bin
6 TERM=screen
8 [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
9 TMUX="$TEST_TMUX -Ltest"
10 $TMUX kill-server 2>/dev/null
12 TMP=$(mktemp)
13 trap "rm -f $TMP" 0 1 15
15 cat <<EOF >$TMP
16 set -g base-index 100
17 new
18 set base-index 200
19 neww
20 EOF
22 $TMUX -f$TMP start
23 echo $($TMUX lsw -F'#{window_index}') >$TMP
24 (echo "100 200"|cmp -s - $TMP) || exit 1
25 $TMUX kill-server 2>/dev/null
27 exit 0