aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyops.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-12-20 22:43:37 +0100
committerBoris Faure <billiob@gmail.com>2016-12-20 22:43:37 +0100
commit99f55b7bbc4d375d3b4525e449001dad6e536cdd (patch)
tree89efa6f0c927678275a327a2a73fc61a1f5f87ad /src/bin/termptyops.c
parenttermio: fix getting selection of known link. CID1367486 (diff)
downloadterminology-99f55b7bbc4d375d3b4525e449001dad6e536cdd.tar.gz
termptyesc: support DECSED3 to erase the backlog. Closes https://phab.enlightenment.org/T3713
Diffstat (limited to 'src/bin/termptyops.c')
-rw-r--r--src/bin/termptyops.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 0a69ed2..698efbb 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -275,6 +275,29 @@ termpty_clear_tabs_on_screen(Termpty *ty)
}
}
+void
+termpty_clear_backlog(Termpty *ty)
+{
+ int backsize;
+
+ ty->backlog_beacon.screen_y = 0;
+ ty->backlog_beacon.backlog_y = 0;
+
+ termpty_backlog_lock();
+ if (ty->back)
+ {
+ size_t i;
+ for (i = 0; i < ty->backsize; i++)
+ termpty_save_free(&ty->back[i]);
+ free(ty->back);
+ ty->back = NULL;
+ }
+ ty->backpos = 0;
+ backsize = ty->backsize;
+ ty->backsize = 0;
+ termpty_backlog_size_set(ty, backsize);
+ termpty_backlog_unlock();
+}
void
termpty_clear_screen(Termpty *ty, Termpty_Clear mode)
@@ -370,7 +393,6 @@ termpty_reset_att(Termatt *att)
void
termpty_reset_state(Termpty *ty)
{
- int backsize;
int i;
ty->cursor_state.cx = 0;
@@ -403,24 +425,7 @@ termpty_reset_state(Termpty *ty)
ty->mouse_ext = MOUSE_EXT_NONE;
ty->bracketed_paste = 0;
- ty->backlog_beacon.screen_y = 0;
- ty->backlog_beacon.backlog_y = 0;
-
- termpty_backlog_lock();
- if (ty->back)
- {
- size_t j;
- for (j = 0; j < ty->backsize; j++)
- termpty_save_free(&ty->back[j]);
- free(ty->back);
- ty->back = NULL;
- }
- ty->backpos = 0;
- backsize = ty->backsize;
- ty->backsize = 0;
- termpty_backlog_size_set(ty, backsize);
- termpty_backlog_unlock();
-
+ termpty_clear_backlog(ty);
termpty_clear_tabs_on_screen(ty);
for (i = 0; i < ty->w; i += TAB_WIDTH)
{