1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Escape key clears input line

This commit is contained in:
James Booth 2012-10-22 23:30:20 +01:00
parent f9b4abe3da
commit f5f7b99e1a

View File

@ -72,6 +72,9 @@ static void _parameter_autocomplete(char *input, int *size, char *command,
void void
create_input_window(void) create_input_window(void)
{ {
if (getenv("ESCDELAY") == NULL)
ESCDELAY = 25;
int rows, cols; int rows, cols;
getmaxyx(stdscr, rows, cols); getmaxyx(stdscr, rows, cols);
@ -220,6 +223,11 @@ _handle_edit(const int ch, char *input, int *size)
switch(ch) { switch(ch) {
case 27: // ESC
*size = 0;
inp_clear();
return 1;
case 127: case 127:
case KEY_BACKSPACE: case KEY_BACKSPACE:
contact_list_reset_search_attempts(); contact_list_reset_search_attempts();