This patch fixes the problems with hide/unhide.
>From d14745fa4d678c0b9abb21f8f2fe2913e30c26b0 Mon Sep 17 00:00:00 2001
From: "Roberto E. Vargas Caballero" <k...@shike2.com>
Date: Wed, 7 Nov 2012 10:38:05 +0100
Subject: [PATCH] Fix bug restoring cursor position

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
@@ -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

  • [dev] [st] Patch Roberto E. Vargas Caballero

Reply via email to