fix: Resolve terminal color initialization crash by using safe color pair
This commit is contained in:
parent
6aa6881f0b
commit
68e65cd851
3
gtm2.py
3
gtm2.py
|
|
@ -552,7 +552,8 @@ def main(stdscr, filename, show_diff, show_add, show_del, mouse):
|
|||
if curses.has_colors():
|
||||
curses.use_default_colors()
|
||||
curses.init_pair(1, 5, 7)
|
||||
curses.init_pair(2, curses.COLOR_WHITE, 8)
|
||||
# Use a safe background color (7 or less) to avoid "Color number is greater than COLORS-1" error
|
||||
curses.init_pair(2, curses.COLOR_WHITE, 0) # Use black (0) instead of 8
|
||||
curses.init_pair(3, curses.COLOR_GREEN, -1)
|
||||
curses.init_pair(4, curses.COLOR_RED, -1)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue