]> Sergey Matveev's repositories - nnn.git/commitdiff
Clear prompt after running a command.
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 17 Nov 2019 00:06:39 +0000 (05:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 17 Nov 2019 00:06:39 +0000 (05:36 +0530)
src/nnn.c

index 5c9ad719bf881240d16aa269a5b2a56f5f9ab28d..7ee23addc93d28e8912c56e5799f4231e46fad5f 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1976,6 +1976,16 @@ static int filterentries(char *path)
                                /* If there's a filter, try a command on ^P */
                                if (cfg.filtercmd && *ch == CONTROL('P') && len > 1) {
                                        prompt_run(pln, (ndents ? dents[cur].name : ""), path);
+
+                                       /* Clear the prompt */
+                                       while (len > 1)
+                                               wln[--len] = '\0';
+                                       wcstombs(ln, wln, REGEX_MAX);
+                                       ndents = total;
+                                       if (matches(pln) != -1)
+                                               redraw(path);
+
+                                       printprompt(ln);
                                        continue;
                                }