bash: support home and end keys

This commit contains a patch of bash's built-in default escape sequences
to match the 'screen' terminal as used by Genode's terminal component.

Fixes #2705
This commit is contained in:
Norman Feske 2018-07-02 16:26:21 +02:00
parent b485caf33c
commit 170507a85c
3 changed files with 21 additions and 2 deletions

View File

@ -1 +1 @@
684c11f9930bea31e50453bf0c26fa3411dfed0c
02edac1a780fc13b59c3c8ad64cc6d390d1e9cc5

View File

@ -10,5 +10,6 @@ DIR(bash) := src/noux-pkg/bash
PATCHES := src/noux-pkg/bash/build.patch \
src/noux-pkg/bash/check_dev_tty.patch \
src/noux-pkg/bash/disable_man2html.patch
src/noux-pkg/bash/disable_man2html.patch \
src/noux-pkg/bash/home_end.patch
PATCH_OPT := -p1 -d src/noux-pkg/bash

View File

@ -0,0 +1,18 @@
This patch adjust the default encoding for the home and end keys to match the
'screen' terminal as used by Genode. It is related to the following issue:
https://github.com/genodelabs/genode/issues/2705
--- a/lib/readline/readline.c
+++ b/lib/readline/readline.c
@@ -1293,8 +1293,8 @@
rl_bind_keyseq_if_unbound ("\033OB", rl_get_next_history);
rl_bind_keyseq_if_unbound ("\033OC", rl_forward_char);
rl_bind_keyseq_if_unbound ("\033OD", rl_backward_char);
- rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line);
- rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line);
+ rl_bind_keyseq_if_unbound ("\033[1~", rl_beg_of_line);
+ rl_bind_keyseq_if_unbound ("\033[4~", rl_end_of_line);
#if defined (__MINGW32__)
rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history);