]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Robert de Bath's patch: be a little more careful of main and
authorSimon Tatham <anakin@pobox.com>
Sat, 11 Mar 2000 14:10:10 +0000 (14:10 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 11 Mar 2000 14:10:10 +0000 (14:10 +0000)
alternate screens when resizing the window. Should avoid lines of
alternate screen showing up in scrollback buffer.

[originally from svn r403]

terminal.c

index de9c7eb9e23b1d787546ec422e9b1f135d2f0c8d..b0cc3548b5f013a0402b1fb4266ee8dc7195dd02 100644 (file)
@@ -204,9 +204,14 @@ void term_size(int newrows, int newcols, int newsavelines) {
     unsigned long *newtext, *newdisp, *newwant, *newalt;
     int i, j, crows, ccols;
 
+    int save_alt_which = alt_which;
+
     if (newrows == rows && newcols == cols && newsavelines == savelines)
        return;                        /* nothing to do */
 
+    deselect();
+    swap_screen(0);
+
     alt_t = marg_t = 0;
     alt_b = marg_b = newrows - 1;
 
@@ -280,7 +285,8 @@ void term_size(int newrows, int newcols, int newsavelines) {
     savelines = newsavelines;
     fix_cpos;
 
-    deselect();
+    swap_screen(save_alt_which);
+
     update_sbar();
     term_update();
 }