Skip to content

Commit

Permalink
util/readline: Add C-n, C-p shortcuts
Browse files Browse the repository at this point in the history
C-n and C-p are the default bindings for readline's next-history and
previous-history respectively. They have the same functionality as the
Down and Up arrow keys.

Signed-off-by: Manos Pitsidianakis <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-ID: <9876594132d1f2e7210ab3f7ca01a82f95206447.1718265822.git.manos.pitsidianakis@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
  • Loading branch information
epilys authored and philmd committed Jun 19, 2024
1 parent 9051350 commit 96c99e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,14 @@ void readline_handle_byte(ReadLineState *rs, int ch)
rs->last_cmd_buf_size = 0;
rs->readline_func(rs->opaque, rs->cmd_buf, rs->readline_opaque);
break;
case 14:
/* ^N Next line in history */
readline_down_char(rs);
break;
case 16:
/* ^P Prev line in history */
readline_up_char(rs);
break;
case 23:
/* ^W */
readline_backword(rs);
Expand Down

0 comments on commit 96c99e3

Please sign in to comment.