fix: Ensure full reverse video background for multi-line status bar

This commit is contained in:
n loewen (aider) 2025-06-08 09:31:01 +01:00
parent 50e4401399
commit 46760052d7
1 changed files with 11 additions and 5 deletions

16
gtm
View File

@ -841,11 +841,17 @@ def draw_help_popup(stdscr, state):
def draw_status_bar_background(stdscr, layout: StatusBarLayout): def draw_status_bar_background(stdscr, layout: StatusBarLayout):
"""Fill the entire status bar area with reverse video background""" """Fill the entire status bar area with reverse video background"""
for y in range(layout.start_y, layout.start_y + layout.total_height): for y in range(layout.start_y, layout.start_y + layout.total_height):
for x in range(layout.screen_width - 1): try:
try: # Fill the entire line with spaces in reverse video
stdscr.addch(y, x, ' ', curses.A_REVERSE) # This is more efficient than adding characters one by one
except curses.error: stdscr.addstr(y, 0, ' ' * layout.screen_width, curses.A_REVERSE)
pass except curses.error:
# If we can't fill the entire line at once, try character by character
for x in range(layout.screen_width):
try:
stdscr.addch(y, x, ' ', curses.A_REVERSE)
except curses.error:
pass
def draw_main_status_line(stdscr, state: AppState, layout: StatusBarLayout): def draw_main_status_line(stdscr, state: AppState, layout: StatusBarLayout):
"""Draw the main status line (percentages, indicators, etc.)""" """Draw the main status line (percentages, indicators, etc.)"""