aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyops.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2014-12-08 20:32:27 +0100
committerBoris Faure <billiob@gmail.com>2014-12-08 20:32:27 +0100
commiteb809499216acaf7e36c94976ef5d32c38a69d23 (patch)
tree9409c24404c8924cf8bead7a5d0e46babc6b81c6 /src/bin/termptyops.c
parentFix screen mangling from prompt redraws on resize. Closes T1193 (diff)
downloadterminology-eb809499216acaf7e36c94976ef5d32c38a69d23.tar.gz
reset also removes the scrollback. Closes https://phab.enlightenment.org/T1891
Diffstat (limited to 'src/bin/termptyops.c')
-rw-r--r--src/bin/termptyops.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index bd59460..4d74570 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -390,6 +390,23 @@ _termpty_reset_state(Termpty *ty)
ty->mouse_mode = MOUSE_OFF;
ty->mouse_ext = MOUSE_EXT_NONE;
ty->bracketed_paste = 0;
+
+ termpty_save_freeze();
+ if (ty->back)
+ {
+ int i;
+ for (i = 0; i < ty->backmax; i++)
+ {
+ if (ty->back[i]) termpty_save_free(ty->back[i]);
+ }
+ free(ty->back);
+ ty->back = NULL;
+ }
+ ty->backscroll_num = 0;
+ ty->backpos = 0;
+ if (ty->backmax)
+ ty->back = calloc(1, sizeof(Termsave *) * ty->backmax);
+ termpty_save_thaw();
}
void