Skip to content

Commit

Permalink
add line-feed as ENTER key
Browse files Browse the repository at this point in the history
In Android's adb shell environment test, click ENTER get line-feed.
  • Loading branch information
liuyang1 committed Mar 24, 2015
1 parent cf1bdf5 commit 258ebc6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions linenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ enum KEY_ACTION{
CTRL_F = 6, /* Ctrl-f */
CTRL_H = 8, /* Ctrl-h */
TAB = 9, /* Tab */
LINE_FEED = 10, /* Line Feed */
CTRL_K = 11, /* Ctrl+k */
CTRL_L = 12, /* Ctrl+l */
ENTER = 13, /* Enter */
Expand Down Expand Up @@ -768,6 +769,7 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen,
}

switch(c) {
case LINE_FEED:/* line feed */
case ENTER: /* enter */
history_len--;
free(history[history_len]);
Expand Down

0 comments on commit 258ebc6

Please sign in to comment.