summary refs log tree commit diff stats
path: root/ranger
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 /ranger
parent8c4f4189919b936d8d01db7388eb008896db88d3 (diff)
downloadranger-520dcebc586de13b9371df5bd4b1d1ba3a712e02.tar.gz
gui.ui: Fall back to "linux" terminal when $TERM fails
Diffstat (limited to 'ranger')
-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)
2.0&id=e952d6cb8e67f80fcd2019abf3d30b20dc5b9f7c'>e952d6cb ^
2144cf26 ^
36e4e71e ^
e952d6cb ^





36e4e71e ^
4ea0f69a ^

36e4e71e ^
e952d6cb ^
36e4e71e ^

78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^










4ea0f69a ^

36e4e71e ^
e952d6cb ^


7582555b ^
e952d6cb ^
36e4e71e ^
e952d6cb ^




36e4e71e ^
e952d6cb ^

36e4e71e ^
306c76d8 ^
e952d6cb ^

306c76d8 ^
e952d6cb ^


306c76d8 ^
e952d6cb ^
306c76d8 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

45cf5174 ^
b34fd133 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^
45cf5174 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98