about summary refs log tree commit diff stats
path: root/src/input_win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_win.c')
-rw-r--r--src/input_win.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/input_win.c b/src/input_win.c
index 5ad64d80..ee6317ac 100644
--- a/src/input_win.c
+++ b/src/input_win.c
@@ -241,17 +241,33 @@ _handle_edit(const int ch, char *input, int *size)
     char *next = NULL;
     int inp_y = 0;
     int inp_x = 0;
+    int next_ch;
 
     getmaxyx(stdscr, rows, cols);
     getyx(inp_win, inp_y, inp_x);
 
     switch(ch) {
 
-    case 27: // ESC
-        *size = 0;
-        inp_clear();
+    case 3: // CTRL-C
+        if (prefs_get_ctrlc()) {
+            exit(0);
+        }
         return 1;
 
+    case 27:
+        next_ch = wgetch(inp_win);
+
+        // ESC
+        if (next_ch == ERR) {
+            *size = 0;
+            inp_clear();
+            return 1;
+
+        // ALT-<next_ch>
+        } else {
+            return 1;
+        }
+
     case 127:
     case KEY_BACKSPACE:
         contact_list_reset_search_attempts();