Fix crash on startup when terminal doesnt support colors

This commit is contained in:
Michael Lazar
2017-11-04 14:10:50 -04:00
parent 331492c766
commit 00df45bd34
3 changed files with 15 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ def curses_session():
# return from C start_color() is ignorable.
try:
curses.start_color()
curses.use_default_colors()
except:
_logger.warning('Curses failed to initialize color support')
@@ -92,9 +93,6 @@ def curses_session():
except:
_logger.warning('Curses failed to initialize the cursor mode')
# Assign the terminal's default (background) color to code -1
curses.use_default_colors()
yield stdscr
finally: