summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-08 22:33:01 +0200
committerhut <hut@lavabit.com>2011-10-08 22:33:01 +0200
commit520dcebc586de13b9371df5bd4b1d1ba3a712e02 (patch)
treefcbfb176dceca42d3a66387a391853545aabe393
parent8c4f4189919b936d8d01db7388eb008896db88d3 (diff)
downloadranger-520dcebc586de13b9371df5bd4b1d1ba3a712e02.tar.gz
gui.ui: Fall back to "linux" terminal when $TERM fails
-rw-r--r--ranger/gui/ui.py7
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)