diff --git a/gtm b/gtm index 6c184d2..956823b 100755 --- a/gtm +++ b/gtm @@ -883,12 +883,13 @@ def draw_status_bars(stdscr, state): # Use terminal's default colors for the status bar status_attr = curses.A_NORMAL # Use terminal's default colors - # Fill the top status bar with spaces using reverse video - for x in range(state.width - 1): - try: - stdscr.addch(status_bar_start, x, ' ', curses.A_REVERSE) - except curses.error: - pass + # Fill all status bar lines with spaces using reverse video + for y in range(state.status_bar_height): + for x in range(state.width - 1): + try: + stdscr.addch(state.height - state.status_bar_height + y, x, ' ', curses.A_REVERSE) + except curses.error: + pass # Add left percentage indicator (only if sidebar is visible) if state.show_sidebar: @@ -926,19 +927,11 @@ def draw_status_bars(stdscr, state): right_attr = status_attr if state.focus == "right" else curses.A_REVERSE stdscr.addstr(status_bar_start, right_x, padded_right_status, right_attr) except curses.error: - pass + pass # --- Second status bar (bottom) --- # Draw the commit details in the second status bar - # Fill all status bar lines with spaces using reverse video - for y in range(state.status_bar_height): - for x in range(state.width - 1): - try: - stdscr.addch(state.height - state.status_bar_height + y, x, ' ', curses.A_REVERSE) - except curses.error: - pass - # Draw the commit hash and message on the left if state.commit_hash: commit_info = f" {state.commit_hash} " @@ -956,11 +949,10 @@ def draw_status_bars(stdscr, state): message_lines = [""] # Calculate how many message lines we can display - # We need at least one line for the status bar with hash and author available_message_lines = state.status_bar_height - 1 try: - # Draw the commit hash with bold on the bottom line of the status bar + # Always draw the commit hash and first line of message on the bottom line bottom_line = state.height - 1 stdscr.addstr(bottom_line, 0, commit_info, curses.A_REVERSE | curses.A_BOLD) @@ -982,7 +974,7 @@ def draw_status_bars(stdscr, state): line_available_width = state.width - 4 # Leave some margin if len(line) > line_available_width: line = line[:line_available_width-3] + "..." - # Draw the line with some indentation + # Draw the line with some indentation (going upward from the bottom line) line_y = bottom_line - i stdscr.addstr(line_y, 4, line, curses.A_REVERSE) except curses.error: