From 684b06e0e609044808b5a9c670f9284dbd1febd3 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 1 Jul 2020 18:17:26 -0400 Subject: [PATCH] mutt-launcher: new launcher to fix terminal size issues. --- mutt-launcher | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 mutt-launcher 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 "${@}" -- 2.43.2