Merge branch 'obsd-master'
[tmux.git] / regress / control-client-sanity.sh
blob48ffd0eed9584c3b8052604408ffaba56f579aaa
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
10 TMP=$(mktemp)
11 trap "rm -f $TMP" 0 1 15
13 $TMUX -f/dev/null new -d -x200 -y200 || exit 1
14 $TMUX -f/dev/null splitw || exit 1
15 sleep 1
16 cat <<EOF|$TMUX -C a >$TMP
17 refresh-client -C 200x200
18 selectp -t%0
19 splitw
20 neww
21 splitw
22 selectp -t%0
23 killp -t%1
24 swapp -t%2 -s%3
25 neww
26 splitw
27 splitw
28 selectl tiled
29 killw
30 EOF
31 sleep 1
32 $TMUX has || exit 1
33 $TMUX lsp -aF '#{pane_id} #{window_layout}' >$TMP || exit 1
34 cat <<EOF|cmp -s $TMP - || exit 1
35 %0 f5ab,200x200,0,0[200x50,0,0,0,200x149,0,51,3]
36 %3 f5ab,200x200,0,0[200x50,0,0,0,200x149,0,51,3]
37 %2 dcbd,200x200,0,0[200x100,0,0,2,200x99,0,101,4]
38 %4 dcbd,200x200,0,0[200x100,0,0,2,200x99,0,101,4]
39 EOF
40 $TMUX kill-server 2>/dev/null
42 exit 0