From 6104963b9b936ff031727322e8da8523b8bb7fa8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 15 Aug 2006 22:48:01 +0000 Subject: [PATCH] Er, ahem. Other half of r6788. :-/ [originally from svn r6791] [r6788 == 09f86ce7ec4f57794993c9299e1e4de62e17e075] --- terminal.c | 7 ++++++- terminal.h | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index c24926ae..b88fe069 100644 --- a/terminal.c +++ b/terminal.c @@ -1211,7 +1211,8 @@ static void power_on(Terminal *term, int clear) term->in_vbell = FALSE; term->cursor_on = 1; term->big_cursor = 0; - term->default_attr = term->save_attr = term->curr_attr = ATTR_DEFAULT; + term->default_attr = term->save_attr = + term->alt_save_attr = term->curr_attr = ATTR_DEFAULT; term->term_editing = term->term_echoing = FALSE; term->app_cursor_keys = term->cfg.app_cursor; term->app_keypad_keys = term->cfg.app_keypad; @@ -1812,6 +1813,10 @@ static void swap_screen(Terminal *term, int which, int reset, int keep_cur_pos) if (!reset && !keep_cur_pos) term->save_csattr = term->alt_save_csattr; term->alt_save_csattr = t; + t = term->save_attr; + if (!reset && !keep_cur_pos) + term->save_attr = term->alt_save_attr; + term->alt_save_attr = t; t = term->save_utf; if (!reset && !keep_cur_pos) term->save_utf = term->alt_save_utf; diff --git a/terminal.h b/terminal.h index c98a746d..4288d618 100644 --- a/terminal.h +++ b/terminal.h @@ -135,6 +135,13 @@ struct terminal_tag { bufchain printer_buf; /* buffered data for printer */ printer_job *print_job; + /* ESC 7 saved state for the alternate screen */ + pos alt_savecurs; + int alt_save_attr; + int alt_save_cset, alt_save_csattr; + int alt_save_utf, alt_save_wnext; + int alt_save_sco_acs; + int rows, cols, savelines; int has_focus; int in_vbell;