summary refs log tree commit diff stats
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
parenta986e2bda5ad96d1e9cf53dddabb71405e45e8c1 (diff)
downloadranger-870c30b2316b3217fe4cf706d788f75151ac6537.tar.gz
console: Ensure that cursor is hidden after closing console
-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()
t; 2009-12-11 17:13:59 +0100 committer hut <hut@lavabit.com> 2009-12-11 17:13:59 +0100 restructurations' href='/akspecs/ranger/commit/ranger.py?h=v1.7.0&id=3de15ddd7fb0151e5f43f0b8e7d06bd76568e235'>3de15ddd ^
3d566884 ^
a1d7ed6e ^
3d566884 ^
f8e96a97 ^
465bff73 ^





f027adc0 ^
f8e96a97 ^

0b5c4cbe ^
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