diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-12-19 15:39:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-12-19 15:39:42 -0800 |
commit | 83638902f7d4ecfefe959732409e7db40d429e00 (patch) | |
tree | abd35e259dd16b0b6df5b7a402d90870a8657a1a | |
parent | 8dd11ca0cc7f920974f1314a9b2d50d9f6e7abf1 (diff) | |
download | basta-83638902f7d4ecfefe959732409e7db40d429e00.tar.gz basta-83638902f7d4ecfefe959732409e7db40d429e00.tar.bz2 basta-83638902f7d4ecfefe959732409e7db40d429e00.zip |
bugfix: don't clobber LINES with real terminal size
- In basta.prepare_term, if we already know how many reserved
rows there are, we should not be calling
bsata.query_terminal_lines to get the real terminal size
into LINES. We need to get that into a local variable and
then subtract form that the lines we know are reserved,
and use that for setting the number of lines.
-rw-r--r-- | basta.sh | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -23,13 +23,14 @@ basta.query_terminal_lines() basta.prepare_term() { + local realrows + basta.query_terminal_lines realrows + if [ -z "$basta_prev_reserved_rows" ] ; then - local realrows - basta.query_terminal_lines realrows basta_prev_reserved_rows=$((realrows - LINES)) printf "\n\033[A" else - basta.query_terminal_lines LINES + LINES=$((realrows - $basta_prev_reserved_rows)) fi basta_scroll_lines=$((LINES - 1)) |