From 5f84d6988193a81d52e54696503d624a4e43780e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 5 Jun 2019 19:38:26 -0700 Subject: [PATCH] Fixed issue with clearing display area --- ask.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ask.c b/ask.c index 0593070..409161f 100644 --- a/ask.c +++ b/ask.c @@ -287,7 +287,9 @@ static char *get_input(FILE *in, FILE *out, const char *prompt, const char *init finished: if (picked) picked = memcheck(strdup(picked)); else picked = buf; - fputs("\0338\033[0m\033[K", out); + if (backtrack || prompt[0]) + fprintf(out, "\033[%dD", backtrack + (int)strlen(prompt)); + fputs("\033[0m\033[K", out); return picked; }