diff options
author | hut <hut@lavabit.com> | 2011-10-08 22:33:01 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-10-08 22:33:01 +0200 |
commit | 520dcebc586de13b9371df5bd4b1d1ba3a712e02 (patch) | |
tree | fcbfb176dceca42d3a66387a391853545aabe393 /ranger | |
parent | 8c4f4189919b936d8d01db7388eb008896db88d3 (diff) | |
download | ranger-520dcebc586de13b9371df5bd4b1d1ba3a712e02.tar.gz |
gui.ui: Fall back to "linux" terminal when $TERM fails
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/ui.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 9d36628f..1f3588f9 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -59,7 +59,12 @@ class UI(DisplayableContainer): if fm is not None: self.fm = fm - self.win = curses.initscr() + try: + self.win = curses.initscr() + except _curses.error as e: + if e.args[0] == "setupterm: could not find terminal": + os.environ['TERM'] = 'linux' + self.win = curses.initscr() self.env.keymaps.use_keymap('browser') DisplayableContainer.__init__(self, None) |