summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-06-01 16:57:50 -0500
committerzachir <zachir@librem.one>2023-06-01 16:57:50 -0500
commit7f0f15dd61863da9eae06391b47dcbd2878c3121 (patch)
treedbf03dcd13b2cb2cddf2020cde040a0bb0ff666c
parent5638a4ca099ec3dc884328133fba4c6cd3dceaf8 (diff)
add patch to erase scrollback with clear
-rw-r--r--st.c9
1 files changed, 9 insertions, 0 deletions
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
@@ -985,6 +987,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)
{
fd_set wfd, rfd;