Support resizing in tmux 1.5.
[profile.git] / opt / bin / usize
1 #!/bin/bash -i
2 #
3 # usize: Set urxvt (or terminal which understands the same escape sequences) 
4 #        size.
5 # Usage: usize <width> [<height>]
6 #
7
8 width=${COLUMNS:-80}
9 height=${LINES:-24}
10 tmux_prefix=
11
12 case $# in
13   0)
14     echo "Usage: usize $width $height"
15     exit 1
16   ;;
17   1) width=$1;;
18   2) width=$1; height=$2;;
19 esac
20
21 [ -n "$TMUX" ] && tmux_prefix="\033Ptmux;\033"
22 echo -e "$tmux_prefix\033[8;$height;$width;t"
23 exit 0