From f50af18b765944f8d56dbd13997ea65debf05d29 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 16 Feb 2025 20:58:06 -0800 Subject: 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. --- basta.sh | 6 ++++-- 1 file 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 -- cgit v1.2.3