Hi,

I've noticed a problem with restoring colors when exiting an ncurses
application. It seems to be caused by restoring cursor before the
primary screen is switched back.

It can be reproduced by:
tput smcup; tput setab 1; tput setaf 4; tput sc; tput rc; tput rmcup

The attached patch fixes the problem for me.

-- 
Miroslav Lichvar
Index: src/command.C
===================================================================
RCS file: /schmorpforge/rxvt-unicode/src/command.C,v
retrieving revision 1.415
diff -u -r1.415 command.C
--- src/command.C       26 Apr 2008 03:37:18 -0000      1.415
+++ src/command.C       19 Jun 2008 14:57:52 -0000
@@ -3635,7 +3635,6 @@
             break;
 #endif
           case 1048:           /* alternative cursor save */
-          case 1049:
             if (option (Opt_secondaryScreen))
               if (mode == 0)
                 scr_cursor (RESTORE);
@@ -3727,11 +3726,16 @@
                   scr_erase_screen (2);
               scr_change_screen (state);
               break;
-            case 1049:         /* secondary screen w/ clearing first */
+            case 1049:         /* secondary screen w/ clearing first, 
alternative cursor save */
+              if (option (Opt_secondaryScreen))
+                if (current_screen == PRIMARY)
+                  scr_cursor (SAVE);
               scr_change_screen (state);
               if (option (Opt_secondaryScreen))
                 if (current_screen != PRIMARY)
                   scr_erase_screen (2);
+                else
+                  scr_cursor (RESTORE);
               break;
             default:
               break;
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to