X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=opt%2Fbin%2Fbigtmux;fp=opt%2Fbin%2Fbigtmux;h=b3d083adc2a964219894c4c4d79523d8e65df287;hp=0000000000000000000000000000000000000000;hb=59c39198581757eee1fc00cb707e0d60e5a7df0b;hpb=d20da866a3e37d4b1c4f7480fbe76a2b58489b5f diff --git a/opt/bin/bigtmux b/opt/bin/bigtmux new file mode 100755 index 0000000..b3d083a --- /dev/null +++ b/opt/bin/bigtmux @@ -0,0 +1,20 @@ +#!/bin/bash +# +# bigtmux: Start tmux, resizing the current window to allow a status line in +# addition to an 87x24 display. +# Usage: bigtmux [args] +# + +# Resize only if we're at the default size. +size=$(stty size) +oldcols=${size##* } +cols=${oldcols:-80} +oldlines=${size%% *} +lines=${oldlines:-24} + +[ ${lines:-24} -lt 25 ] && lines=25 +[ ${cols:-80} -lt 87 ] && cols=87 +[ $cols = $oldcols -a $lines = $oldlines ] || usize $cols $lines + +exec ${1+"$@"} +