From 7f0f15dd61863da9eae06391b47dcbd2878c3121 Mon Sep 17 00:00:00 2001 From: zachir Date: Thu, 1 Jun 2023 16:57:50 -0500 Subject: add patch to erase scrollback with clear --- st.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/st.c b/st.c index f98ec34..28a3aaf 100644 --- a/st.c +++ b/st.c @@ -194,6 +194,7 @@ static void stty(char **); static void sigchld(int); static void ttywriteraw(const char *, size_t); +static void histclean(void); static void csidump(void); static void csihandle(void); static void readcolonargs(char **, int, int[][CAR_PER_ARG]); @@ -749,6 +750,7 @@ selclear(void) return; selremove(); tsetdirt(sel.nb.y, sel.ne.y); + histclean(); } void @@ -984,6 +986,13 @@ ttywrite(const char *s, size_t n, int may_echo) } } +void +histclean() +{ + for (int i = 0; i < HISTSIZE; i++) + term.hist[i] = xmalloc(term.col * sizeof(Glyph)); +} + void ttywriteraw(const char *s, size_t n) { -- cgit v1.2.3