From: simon Date: Tue, 27 May 2003 09:43:14 +0000 (+0000) Subject: Experimental change in the behaviour of `disable alternate terminal X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/4c80361f22171ba8b33e51257a1c7d764f65b3ed?ds=sidebyside Experimental change in the behaviour of `disable alternate terminal 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@3222 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/terminal.c b/terminal.c index 5f6cdb19..05a62339 100644 --- a/terminal.c +++ b/terminal.c @@ -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;