mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 19:46:22 +00:00
Escape key clears input line
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user