From 8534e9e277723a48cff9f791253a856506e72aa1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 3 Aug 2023 07:06:59 -0700 Subject: ui fix: don't clear to end of screen. * pw.c (clrline): use the [K sequence rather than the [J sequence so that we only clear this line, not to the rest of the screen. Clearing the rest of the screen trashes any scroll-protected status lines the user may have set up. Vim respects this, for instance. I have a setup like that now and noticed the issue that when I run pw, my status stuff disappears. --- pw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw.c b/pw.c index ef0ccbd..29b4cb5 100644 --- a/pw.c +++ b/pw.c @@ -390,7 +390,7 @@ static int grexec(grep *gr, const char *line) static void clrline(unsigned stat) { if ((stat & stat_bkgnd) == 0) - printf("\r\033[J"); + printf("\r\033[K"); } static void clreol(int nl) -- cgit v1.2.3