]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Experimental change in the behaviour of `disable alternate terminal
authorSimon Tatham <anakin@pobox.com>
Tue, 27 May 2003 09:43:14 +0000 (09:43 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 27 May 2003 09:43:14 +0000 (09:43 +0000)
screen'. Now it also disables the save-and-restore-cursor behaviour
of ESC[?1048h and ESC[?1049h, since these sequences seem to be
output by software trying to switch to the alternate screen, and it
looks very odd to have the cursor position restored to where it was
before `less' when the garbage `less' wrote all over the screen is
still around. The `traditional' ESC 7 and ESC 8 still function as
normal, on the basis that they aren't usually used in conjunction
with the alternate screen. I'm not sure whether this will be the
right decision; I'm prepared to change it back if a sufficiently
serious counterexample shows up.

[originally from svn r3222]

terminal.c

index 5f6cdb199bf4f39aa798c61088162acce08ddcd3..05a62339cf0447fc7899753f9e7b0f1e282aa49d 100644 (file)
@@ -1263,17 +1263,18 @@ static void toggle_mode(Terminal *term, int mode, int query, int state)
            term->disptop = 0;
            break;
          case 1048:                   /* save/restore cursor */
-           save_cursor(term, state);
+           if (!term->cfg.no_alt_screen)
+                save_cursor(term, state);
            if (!state) term->seen_disp_event = TRUE;
            break;
          case 1049:                   /* cursor & alternate screen */
-           if (state)
+           if (state && !term->cfg.no_alt_screen)
                save_cursor(term, state);
            if (!state) term->seen_disp_event = TRUE;
            compatibility(OTHER);
            deselect(term);
            swap_screen(term, term->cfg.no_alt_screen ? 0 : state, TRUE, FALSE);
-           if (!state)
+           if (!state && !term->cfg.no_alt_screen)
                save_cursor(term, state);
            term->disptop = 0;
            break;