[PATCH] Fix bug restoring cursor position

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Wed, 7 Nov 2012 10:38:05 +0100

Sequences like DECSC, DECRC, ESC [?1047l or ESC [?1047h save and restore
cursor position, but not other attributes of the cursor, like Glyph or hide
mode, but st uses a full TCursor variable, which means that it changes all
the attributes of cursor. This caused that depending of the order of
sequences sometimes the cursor was hide when it should be not hidden.
---
 st.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/st.c b/st.c
index f063029..af8bd9a 100644
--- a/st.c
+++ b/st.c
_AT_@ -1044,13 +1044,15 @@ tfulldirt(void) {
 
 void
 tcursor(int mode) {
-	static TCursor c;
+	static int x,y;
 
 	if(mode == CURSOR_SAVE) {
-		c = term.c;
+		x = term.c.x;
+		y = term.c.y;
 	} else if(mode == CURSOR_LOAD) {
-		term.c = c;
-		tmoveto(c.x, c.y);
+		term.c.x = x;
+		term.c.y = y;
+		tmoveto(x, y);
 	}
 }
 
-- 
1.7.10.4
--M9NhX3UHpAaciwkO--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Wed Nov 07 2012 - 11:00:04 CET