From e85131d5cdce20e8ee1e80eb41225dc95a7bcf6d Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 5 Sep 2006 22:08:00 +0000 Subject: [PATCH] CSI 3 J now clears the scrollback, as in xterm. git-svn-id: svn://svn.tartarus.org/sgt/putty@6847 cda61777-01e9-0310-a592-d414129be87e --- terminal.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/terminal.c b/terminal.c index b88fe069..f5603a83 100644 --- a/terminal.c +++ b/terminal.c @@ -3346,10 +3346,17 @@ static void term_out(Terminal *term) break; case 'J': /* ED: erase screen or parts of it */ { - unsigned int i = def(term->esc_args[0], 0) + 1; - if (i > 3) - i = 0; - erase_lots(term, FALSE, !!(i & 2), !!(i & 1)); + unsigned int i = def(term->esc_args[0], 0); + if (i == 3) { + /* Erase Saved Lines (xterm) + * This follows Thomas Dickey's xterm. */ + term_clrsb(term); + } else { + i++; + if (i > 3) + i = 0; + erase_lots(term, FALSE, !!(i & 2), !!(i & 1)); + } } term->disptop = 0; seen_disp_event(term); -- 2.11.0