From 34e350d44fd0db988fc5620acbbf447a81408ddb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 3 Feb 2025 20:54:13 +0000 Subject: Watch for empty response when getting current line. - 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. --- basta.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3