diff options
-rw-r--r-- | basta.sh | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -99,11 +99,19 @@ basta.check_cursor() if ! read -t 0; then local exit=$? local curln=$(basta.get_cur_line) + local realrows if [ $curln ] && [ $curln -gt $basta_scroll_lines ]; then printf $'\e[%s;1H' $basta_scroll_lines fi + + basta.query_terminal_lines realrows + + [ $LINES -eq $((realrows - $basta_prev_reserved_rows - 1)) ] + return $? fi + + return 0 } basta.do_exit_status() @@ -131,10 +139,12 @@ basta.initial_prompt_hook() basta.prompt_hook() { local exit=$? + local winch= + stty raw -echo onlcr opost - basta.check_cursor + basta.check_cursor || winch=WINCH basta.do_exit_status $exit - basta.update_status + basta.update_status $winch stty sane } |