class Tryouts::CLI::TTYStatusDisplay
def clear_status_area
def clear_status_area return unless @available && @status_active with_terminal_safety do # Move to status area and clear it completely - start from first status line @io.print @cursor.move_to(0, TTY::Screen.height - STATUS_LINES + 1) # Clear each line thoroughly STATUS_LINES.times do |i| @io.print @cursor.clear_line @io.print @cursor.down(1) if i < STATUS_LINES - 1 # Don't go down after last line end # Move cursor to a clean area for final output - position it well above the cleared area # This ensures no interference with the cleared status content target_row = TTY::Screen.height - STATUS_LINES - 2 # Leave some buffer space @io.print @cursor.move_to(0, target_row) @io.print "\n" # Add a clean line for final output to start @io.flush end @status_active = false end