diff options
-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) |