about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-22 23:30:20 +0100
committerJames Booth <boothj5@gmail.com>2012-10-22 23:30:20 +0100
commitf5f7b99e1a7ce8494f263f7019131aa2f8f681c9 (patch)
treefea2abee2cab579e9216b18a74348ab2a54ae255 /src
parentf9b4abe3dabd3384524e4506124dce4e9cec6814 (diff)
downloadprofani-tty-f5f7b99e1a7ce8494f263f7019131aa2f8f681c9.tar.gz
Escape key clears input line
Diffstat (limited to 'src')
-rw-r--r--src/input_win.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/input_win.c b/src/input_win.c
index 107d6985..408bd45a 100644
--- a/src/input_win.c
+++ b/src/input_win.c
@@ -72,6 +72,9 @@ static void _parameter_autocomplete(char *input, int *size, char *command,
 void
 create_input_window(void)
 {
+    if (getenv("ESCDELAY") == NULL)
+        ESCDELAY = 25;
+
     int rows, cols;
     getmaxyx(stdscr, rows, cols);
 
@@ -220,6 +223,11 @@ _handle_edit(const int ch, char *input, int *size)
 
     switch(ch) {
 
+    case 27: // ESC
+        *size = 0;
+        inp_clear();
+        return 1;
+
     case 127:
     case KEY_BACKSPACE:
         contact_list_reset_search_attempts();