From: Michael Orlitzky Date: Wed, 1 Jul 2020 22:17:26 +0000 (-0400) Subject: mutt-launcher: new launcher to fix terminal size issues. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mutt.git;a=commitdiff_plain;h=684b06e0e609044808b5a9c670f9284dbd1febd3;hp=dd7bef18199b0a6e84da795aa5f1c9e7379bdce7 mutt-launcher: new launcher to fix terminal size issues. --- diff --git a/mutt-launcher b/mutt-launcher new file mode 100755 index 0000000..761595a --- /dev/null +++ b/mutt-launcher @@ -0,0 +1,23 @@ +#!/bin/sh +# +# This is a wrapper around the "mutt" executable that takes the number +# of columns and lines present in the terminal as its first and second +# arguments. This works around an issue where launching "mutt" right +# away in a brand-new terminal launches it before the COLUMNS and +# LINES variables are set, and thus before "tput" knows how wide the +# terminal is. +# +# You will have to manually compute the right number of columns/rows +# by launching a terminal of your preferred size/font and then using +# "tput cols" and "tput lines" to figure out how many columns/lines +# it has. +# +if [ $# -lt 2 ]; then + echo "Usage: mutt-launcher [other-args]" + exit 1 +fi +export COLUMNS="${1}" +shift +export LINES="${1}" +shift +exec mutt "${@}"