]> gitweb.michael.orlitzky.com - mutt.git/blobdiff - mutt-launcher
mutt-launcher: new launcher to fix terminal size issues.
[mutt.git] / mutt-launcher
diff --git a/mutt-launcher b/mutt-launcher
new file mode 100755 (executable)
index 0000000..761595a
--- /dev/null
@@ -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 <ncols> <nrows> [other-args]"
+    exit 1
+fi
+export COLUMNS="${1}"
+shift
+export LINES="${1}"
+shift
+exec mutt "${@}"