aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-08-25 09:44:41 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-08-25 10:30:37 -0700
commit8e4559b6bf860a918c2096dd34514b6f4c8fdf22 (patch)
tree91f89ad58bf31bf048a129d0edf0aa4157cba794
parent4e1fae2dd161778bc53d40ae0d9ce40229cf09f7 (diff)
downloadbasta-8e4559b6bf860a918c2096dd34514b6f4c8fdf22.tar.gz
basta-8e4559b6bf860a918c2096dd34514b6f4c8fdf22.tar.bz2
basta-8e4559b6bf860a918c2096dd34514b6f4c8fdf22.zip
Work harder at protecting the TTY rows.
- New variable basta_scroll_lines tracks the correct of LINES and tty rows. - In basta.prepare_term, we set the value of this variable. Also, bugfix: we were referring to some nonexistent variables in the calculation. Luckily the bogus term existing_reserved-rows evaluated to 0. - In basta.prompt_hook we set the tty rows to basta_scroll_lines.
-rw-r--r--basta.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/basta.sh b/basta.sh
index 271caa0..8782177 100644
--- a/basta.sh
+++ b/basta.sh
@@ -4,6 +4,7 @@ basta_old_cmdno=${basta_old_cmdno-0}
basta_old_lines=${basta_old_lines-0}
basta_old_cols=${basta_old_cols-0}
+basta_scroll_lines=${basta_scroll_lines-$LINES}
basta_prev_reserved_rows=${basta_prev_reserved_rows-}
basta_status_alarm_pid=${basta_status_alarm_pid-}
@@ -24,7 +25,8 @@ basta.prepare_term()
printf "\n\033[A"
fi
- stty rows $((LINES - existing_reserved-rows - 1))
+ basta_scroll_lines=$((LINES - 1))
+ stty rows $basta_scroll_lines
basta_old_lines=$LINES
basta_old_cols=$COLUMNS
}
@@ -102,7 +104,7 @@ basta.prompt_hook()
basta.check_cursor
basta.do_exit_status $exit
basta.update_status
- stty sane
+ stty sane rows $basta_scroll_lines
}
basta.alarm_timer()