From 7c2e2963150c6efb22619cec5cd7202eb14f1eb4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 17 Feb 2025 18:42:19 -0800 Subject: Get rid of deep flag in update. * basta.sh (basta.update_status): Eliminate the deep flag. Always repaint all the status lines together. Without this, if the user runs the reset command, the lower status lines disappear. I.e. it worked better with the bug whereby we were always setting deep=y. --- basta.sh | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/basta.sh b/basta.sh index af96e02..fdf994e 100644 --- a/basta.sh +++ b/basta.sh @@ -101,19 +101,14 @@ basta.update_status() local tio_lines local tio_cols local i j - local deep= basta.query_termios_lines_cols tio_lines tio_cols - if ! [ "$1" != WINCH -a \ - $LINES -eq $basta_old_lines -a \ - $COLUMNS -eq $basta_old_cols -a \ - $LINES -eq $tio_lines -a \ - $COLUMNS -eq $tio_cols ] - then - basta.prepare_term - deep=y - fi + [ "$1" != WINCH -a \ + $LINES -eq $basta_old_lines -a \ + $COLUMNS -eq $basta_old_cols -a \ + $LINES -eq $tio_lines -a \ + $COLUMNS -eq $tio_cols ] || basta.prepare_term local status_esc=$'\e[7m\e[m' local status_date=$(date +%m-%d/%H:%M) @@ -135,16 +130,14 @@ basta.update_status() printf $'\e7\e[%s;1H\e[K%s\e[1;%sr' \ $((basta_scroll_lines + 1)) "$status" $basta_scroll_lines - if [ $deep ] ; then - printf $'\e[=7l' - for (( i = $basta_prev_reserved_rows - 1, j = 2; i >= 0; i--, j++ )) ; do - printf $'\e[%s;1H\e[K%s' \ - $((basta_scroll_lines + j)) "${LC_basta_status[i]}" - done - printf $'\e[=7h' - fi + printf $'\e[=7l' + for (( i = $basta_prev_reserved_rows - 1, j = 2; i >= 0; i--, j++ )) ; do + printf $'\e[%s;1H\e[K%s' \ + $((basta_scroll_lines + j)) "${LC_basta_status[i]}" + done + printf $'\e[=7h' - printf '\e8' + printf $'\e8' LC_basta_status[$basta_prev_reserved_rows]=$status basta.export_array LC_basta_status -- cgit v1.2.3