Add method for moving cursor up and to the beginning.
This commit is contained in:
parent
984cde114a
commit
9fd4c97fac
@ -290,7 +290,7 @@ module Homebrew
|
||||
end
|
||||
|
||||
if previous_pending_line_count.positive?
|
||||
$stdout.print Tty.move_cursor_up(previous_pending_line_count)
|
||||
$stdout.print Tty.move_cursor_up_beginning(previous_pending_line_count)
|
||||
$stdout.flush
|
||||
end
|
||||
|
||||
|
||||
@ -56,6 +56,11 @@ module Tty
|
||||
"\033[#{line_count}A"
|
||||
end
|
||||
|
||||
sig { params(line_count: Integer).returns(String) }
|
||||
def move_cursor_up_beginning(line_count)
|
||||
"\033[#{line_count}F"
|
||||
end
|
||||
|
||||
sig { params(line_count: Integer).returns(String) }
|
||||
def move_cursor_down(line_count)
|
||||
"\033[#{line_count}B"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user