aboutsummaryrefslogtreecommitdiffstats
path: root/pw.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-08-03 07:06:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-08-03 07:06:59 -0700
commit8534e9e277723a48cff9f791253a856506e72aa1 (patch)
tree12d1a243fc0c0193d5de0aa48754ad2c43a70e26 /pw.c
parent60ef2a41f547fb5b0a3cfd553f65cfbd700b3da6 (diff)
downloadpw-8534e9e277723a48cff9f791253a856506e72aa1.tar.gz
pw-8534e9e277723a48cff9f791253a856506e72aa1.tar.bz2
pw-8534e9e277723a48cff9f791253a856506e72aa1.zip
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.
Diffstat (limited to 'pw.c')
-rw-r--r--pw.c2
1 files changed, 1 insertions, 1 deletions
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)