Add safety check for terminals without cursor support.

This commit is contained in:
Michael Lazar
2017-01-06 22:47:29 -08:00
parent 0767c8fcab
commit e9cd4c4458
2 changed files with 20 additions and 6 deletions

View File

@@ -57,10 +57,14 @@ def curses_session():
try:
curses.start_color()
except:
_logger.warning('Curses failed to initialize color support')
pass
# Hide the blinking cursor
curses.curs_set(0)
try:
curses.curs_set(0)
except:
_logger.warning('Curses failed to initialize the cursor mode')
# Assign the terminal's default (background) color to code -1
curses.use_default_colors()