Merge branch 'obsd-master'
[tmux.git] / regress / cursor-test2.sh
blob9791f56708f99f80630cb6c359b6bb261a2d136e
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 -x10 -y10 \
14 "cat cursor-test.txt; printf '\e[8;10H'; cat" || exit 1
15 $TMUX set -g window-size manual || exit 1
17 $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP
18 $TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP
19 $TMUX resizew -x5 || exit 1
20 $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP
21 $TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP
22 $TMUX resizew -x50 || exit 1
23 $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP
24 $TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP
26 cmp -s $TMP cursor-test2.result || exit 1
28 $TMUX kill-server 2>/dev/null
29 exit 0