tmux/regress/control-client-size.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

2017-05-28 18:19:10 +00:00
#!/bin/sh
# 947
2017-05-28 19:15:45 +00:00
# size in control mode should change after refresh-client -C, and -x and -y
# should work without -d for control clients
2017-05-28 18:19:10 +00:00
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)
OUT=$(mktemp)
trap "rm -f $TMP $OUT" 0 1 15
2017-05-28 18:19:10 +00:00
2017-05-28 18:53:08 +00:00
$TMUX -f/dev/null new -d || exit 1
2017-05-28 18:19:10 +00:00
sleep 1
cat <<EOF|$TMUX -C a >$TMP
ls -F':#{window_width} #{window_height}'
2017-05-28 18:19:10 +00:00
refresh -C 100,50
ls -F':#{window_width} #{window_height}'
2017-05-28 18:19:10 +00:00
EOF
grep ^: $TMP >$OUT
printf ":80 24\n:100 49\n"|cmp -s $OUT - || exit 1
2017-05-28 18:19:10 +00:00
$TMUX kill-server 2>/dev/null
2017-05-28 18:53:08 +00:00
$TMUX -f/dev/null new -d || exit 1
2017-05-28 18:19:10 +00:00
sleep 1
2019-04-02 10:11:19 +00:00
cat <<EOF|$TMUX -f/dev/null -C a >$TMP
ls -F':#{window_width} #{window_height}'
2017-05-28 18:19:10 +00:00
refresh -C 80,24
ls -F':#{window_width} #{window_height}'
2017-05-28 18:19:10 +00:00
EOF
grep ^: $TMP >$OUT
printf ":80 24\n:80 23\n"|cmp -s $OUT - || exit 1
2017-05-28 18:19:10 +00:00
$TMUX kill-server 2>/dev/null
2019-04-02 10:11:19 +00:00
cat <<EOF|$TMUX -f/dev/null -C new -x 100 -y 50 >$TMP
ls -F':#{window_width} #{window_height}'
2017-05-28 19:15:45 +00:00
refresh -C 80,24
ls -F':#{window_width} #{window_height}'
2017-05-28 19:15:45 +00:00
EOF
grep ^: $TMP >$OUT
printf ":100 50\n:80 23\n"|cmp -s $OUT - || exit 1
2017-05-28 19:15:45 +00:00
$TMUX kill-server 2>/dev/null
2017-05-28 18:19:10 +00:00
exit 0