summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-14 23:29:14 +0100
committerhut <hut@lavabit.com>2010-02-14 23:43:48 +0100
commit870c30b2316b3217fe4cf706d788f75151ac6537 (patch)
treec11130cc310cb0ef04fa4e44097408e2998c5b41 /ranger
parenta986e2bda5ad96d1e9cf53dddabb71405e45e8c1 (diff)
downloadranger-870c30b2316b3217fe4cf706d788f75151ac6537.tar.gz
console: Ensure that cursor is hidden after closing console
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/console.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 754ca870..3dfa0ce7 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -42,7 +42,7 @@ class Console(Widget):
 	mode = None
 	visible = False
 	commandlist = None
-	last_cursor_mode = 1
+	last_cursor_mode = None
 	prompt = ':'
 	copy = ''
 	tab_deque = None
@@ -88,7 +88,8 @@ class Console(Widget):
 
 		cls = mode_to_class(mode)
 
-		self.last_cursor_mode = curses.curs_set(1)
+		if self.last_cursor_mode is None:
+			self.last_cursor_mode = curses.curs_set(1)
 		self.mode = mode
 		self.__class__ = cls
 		self.history = self.histories[DEFAULT_HISTORY]
@@ -103,7 +104,9 @@ class Console(Widget):
 		return True
 
 	def close(self):
-		curses.curs_set(self.last_cursor_mode)
+		if self.last_cursor_mode is not None:
+			curses.curs_set(self.last_cursor_mode)
+			self.last_cursor_mode = None
 		self.add_to_history()
 		self.tab_deque = None
 		self.clear()
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214