diff options
-rw-r--r-- | src/wreadln.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wreadln.c b/src/wreadln.c index 8694bb367..fd653329b 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -38,6 +38,7 @@ #define KEY_CTRL_E 5 #define KEY_CTRL_G 7 #define KEY_CTRL_K 11 +#define KEY_CTRL_U 21 #define KEY_CTRL_Z 26 #define KEY_BCKSPC 8 #define TAB 9 @@ -279,6 +280,12 @@ _wreadln(WINDOW *w, case KEY_CTRL_K: line[cursor] = 0; break; + case KEY_CTRL_U: + cursor = my_strlen(line); + for (i = 0;i < cursor; i++) + line[i] = '\0'; + cursor = 0; + break; case 127: case KEY_BCKSPC: /* handle backspace: copy all */ case KEY_BACKSPACE: /* chars starting from curpos */ @@ -702,6 +709,12 @@ _wreadln(WINDOW *w, case KEY_CTRL_K: wline[cursor] = 0; break; + case KEY_CTRL_U: + cursor = wcslen(wline); + for (i = 0;i < cursor; i++) + wline[i] = '\0'; + cursor = 0; + break; case KEY_CTRL_Z: sigstop(); break; |