Files
Cody Boone Ferguson 88e8d6a83d Improve make fullscreen in 2019/duble + formatting
The Makefile now uses the script fullscreen.sh which should also be
slightly more portable in that it doesn't rely on both stty(1) and
sed(1). Instead it relies on tput(1). Like the Makefile did for stty(1),
the script checks for tput(1). But rather than suggesting that the user
manually update the Makefile (without instructions) it now gives a
command that one can use to do the equivalent. This is assuming that the
environmental variables LINES and COLUMNS exist. Unfortunately these
variables are not available to scripts so it can't be done
automatically. This script also (if tput(1) cannot be found) shows a
more general way of how to change the size of the editor (the README.md
also does this). One can do something like

    make clobber LINES=20 COLUMNS=20 all

to get a 20 x 20 editor.

The fullscreen.sh script was added to simplify the above procedure.

The README.md file was format/typo checked.

I updated the bugs.md as well: I noticed another condition where the
program can become locked, forcing one to have to kill it. At the same
time I improved the way to find sockets that are left by the program
(the way before had the problem that other dot files with all cap
letters could be found) and also an improved way to delete them (which
there is no Makefile rule to do). Now bugs.md discusses both the locking
and the sockets being left in the directory.
2023-12-18 09:25:55 -08:00

21 lines
542 B
Bash
Executable File

#!/usr/bin/env bash
#
# Try and determine full screen size for make fullscreen rule.
#
TPUT="$(type -P tput)"
if [[ -z "$TPUT" ]]; then
echo "No tput found, try:" >&2
echo >&2
echo " make clobber LINES=\$LINES COLUMNS=\$COLUMNS all" >&2
echo >&2
echo "or to specify a specific size:" >&2
echo >&2
echo " make clobber LINES=20 COLUMNS=20 all" >&2
echo >&2
echo "or whatever you wish the lines and columns to be." >&2
exit 1
else
make clobber all LINES="$($TPUT lines)" COLUMNS="$($TPUT cols)"
fi