aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-02-03 20:54:13 +0000
committerKaz Kylheku <kaz@kylheku.com>2025-02-03 20:54:13 +0000
commit34e350d44fd0db988fc5620acbbf447a81408ddb (patch)
tree87e115fef49faa0ab65e6c9f24f9eb5571cde9a5
parentca9ae4d1f17ec05f4dd43dd8113661463917a080 (diff)
downloadbasta-master.tar.gz
basta-master.tar.bz2
basta-master.zip
Watch for empty response when getting current line.HEADmaster
- When we query the current line from the terminal, there are situations when that might time out and yield a blank response. In basta.check_cursor, we guard against that, or else the user may, rarely, see a message complaining that the [ command is missing an operand for the -gt operator.
-rw-r--r--basta.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/basta.sh b/basta.sh
index 776ab4e..962e8c6 100644
--- a/basta.sh
+++ b/basta.sh
@@ -99,7 +99,7 @@ basta.check_cursor()
local exit=$?
local curln=$(basta.get_cur_line)
- if [ $curln -gt $basta_scroll_lines ]; then
+ if [ $curln ] && [ $curln -gt $basta_scroll_lines ]; then
printf $'\e[%s;1H' $basta_scroll_lines
fi
fi