diff options
author | Manos Pitsidianakis <manos.pitsidianakis@linaro.org> | 2024-06-13 11:06:12 +0300 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-06-19 12:42:03 +0200 |
commit | 96c99e38312c517115a9c4f9e9d409059818e56d (patch) | |
tree | 7b50212d72b84f686fae8f83870b24eeb0e4c7be /util | |
parent | 9051350d25e58bb091ea51b5fde861ee7c3aafba (diff) | |
download | qemu-96c99e38312c517115a9c4f9e9d409059818e56d.zip qemu-96c99e38312c517115a9c4f9e9d409059818e56d.tar.gz qemu-96c99e38312c517115a9c4f9e9d409059818e56d.tar.bz2 |
util/readline: Add C-n, C-p shortcuts
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 <manos.pitsidianakis@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <9876594132d1f2e7210ab3f7ca01a82f95206447.1718265822.git.manos.pitsidianakis@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/readline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/readline.c b/util/readline.c index ded31b0..0b627d6 100644 --- a/util/readline.c +++ b/util/readline.c @@ -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); |