From f5f7b99e1a7ce8494f263f7019131aa2f8f681c9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 22 Oct 2012 23:30:20 +0100 Subject: [PATCH] Escape key clears input line --- src/input_win.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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();