diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2013-05-02 23:22:36 +0200 |
---|---|---|
committer | hasufell <julian.ospald@googlemail.com> | 2013-05-09 00:39:22 +0200 |
commit | 67f367938ef8f02a1bcc8614197d455a78d07424 (patch) | |
tree | e5675b5a46f3d690e9b7d809d854a8b4283f4e40 /elogv | |
parent | Add compression support (diff) | |
download | elogv-67f367938ef8f02a1bcc8614197d455a78d07424.tar.gz elogv-67f367938ef8f02a1bcc8614197d455a78d07424.tar.bz2 elogv-67f367938ef8f02a1bcc8614197d455a78d07424.zip |
Fix crash with TERM=vt100
Diffstat (limited to 'elogv')
-rwxr-xr-x | elogv | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -104,12 +104,15 @@ class ElogViewer: self.screen = screen # Our color pairs - curses.use_default_colors() - curses.init_pair(selected, curses.COLOR_BLACK, curses.COLOR_WHITE) - curses.init_pair(einfo, curses.COLOR_GREEN, curses.COLOR_BLACK) - curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK) - curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK) - curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK) + try: + curses.use_default_colors() + curses.init_pair(selected, curses.COLOR_BLACK, curses.COLOR_WHITE) + curses.init_pair(einfo, curses.COLOR_GREEN, curses.COLOR_BLACK) + curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK) + curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK) + curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK) + except curses.error: # e.g. with "TERM=vt100 elogv" invokation + pass # This attributes are used to manage the scrolling of the list # of files |