Permalink
Browse files

Support for Ctrl+u added

  • Loading branch information...
1 parent 62be166 commit 4b9fe35867b1f5e131188552e302ae8918edccd4 @antirez committed Mar 21, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 linenoise.c
View
@@ -259,6 +259,11 @@ static int linenoisePrompt(int fd, char *buf, size_t buflen, char *prompt) {
}
}
break;
+ case 21: /* Ctrl+U, delete the whole line. */
+ buf[0] = '\0';
+ pos = len = 0;
+ refreshLine(fd,prompt,buf,len,pos,cols);
+ break;
case 11: /* Ctrl+K, delete from current to end of line. */
buf[pos] = '\0';
len = pos;

0 comments on commit 4b9fe35

Please sign in to comment.