aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-02-16 20:58:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2025-02-16 20:58:06 -0800
commitf50af18b765944f8d56dbd13997ea65debf05d29 (patch)
treee10902dbf124b3ac247d1f362dd9c2495a64edcb
parent9ab0e3d7cc12f41a89139e2ae1fdf9b6c459243d (diff)
downloadbasta-f50af18b765944f8d56dbd13997ea65debf05d29.tar.gz
basta-f50af18b765944f8d56dbd13997ea65debf05d29.tar.bz2
basta-f50af18b765944f8d56dbd13997ea65debf05d29.zip
fullscreen: code cleanup and minor issue.
* basta.sh (basta.fullscreen): Clear to to the end of screen in the else case of testing for -s, and set basta_deferred_intr there. It doesn't matter that we do this clearing before resetting the scrolling region. A a result, we don't have to test the $saveterm variable again before running the command. The old structure with || and && was not correct; the intent is to set basta_deffered_intro to WINCH only if we are not saving and restoring the terminal.
-rw-r--r--basta.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/basta.sh b/basta.sh
index f6b0b12..7dd109b 100644
--- a/basta.sh
+++ b/basta.sh
@@ -328,13 +328,15 @@ basta.fullscreen()
shift
saveterm=y
printf $'\e[?1049h' >&$ttyfd
+ else
+ basta_deferred_intr=WINCH
+ printf $'\e[J' >&$ttyfd
fi
+
printf $'\e7\e[1;%sr\e8' $realrows >&$ttyfd
stty rows $realrows <&$ttyfd
- [ $saveterm ] || printf $'\e[J' >&$ttyfd && basta_deferred_intr=WINCH
-
LINES=$realrows command "$@" || exit=$?
if [ $saveterm ] ; then