about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-07-13 22:59:42 +0100
committerJames Booth <boothj5@gmail.com>2013-07-13 23:02:36 +0100
commit1d05a7047314fa3c669358114dc6ce36bbc08386 (patch)
tree3f50dddec96300fcf7e0d267a40956ba2616be02 /src/ui
parent907beb55f6dba952b6b07579c919fad251b7a0c0 (diff)
downloadprofani-tty-1d05a7047314fa3c669358114dc6ce36bbc08386.tar.gz
Down arrow adds current line to history and shows empty line
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/inputwin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 3f3d2ab5..feb4a0ba 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -490,6 +490,10 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
             next = cmd_history_next(input, size);
             if (next) {
                 inp_replace_input(input, next, size);
+            } else if (*size != 0) {
+                input[*size] = '\0';
+                cmd_history_append(input);
+                inp_replace_input(input, "", size);
             }
             return 1;