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()