From bfea27a258b18d56debc06ed963a68934a64a53c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 26 Mar 2021 11:18:20 +0100 Subject: [PATCH] Tweak to support delete key in bash This commit modified bash's builtin mapping of character sequences to readline-functionality to detect the sequence of the delete symbol as generated by the terminal. Fixes #4058 --- repos/ports/ports/bash.hash | 2 +- repos/ports/ports/bash.port | 2 +- .../bash/{home_end.patch => home_end_delete.patch} | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) rename repos/ports/src/noux-pkg/bash/{home_end.patch => home_end_delete.patch} (61%) diff --git a/repos/ports/ports/bash.hash b/repos/ports/ports/bash.hash index 4874644b38..410b1738ad 100644 --- a/repos/ports/ports/bash.hash +++ b/repos/ports/ports/bash.hash @@ -1 +1 @@ -02edac1a780fc13b59c3c8ad64cc6d390d1e9cc5 +c54af4376c78eb9e3d1463bd015ca4cd75770954 diff --git a/repos/ports/ports/bash.port b/repos/ports/ports/bash.port index 1bb1d159d0..18bc7cae3f 100644 --- a/repos/ports/ports/bash.port +++ b/repos/ports/ports/bash.port @@ -11,5 +11,5 @@ 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/home_end.patch + src/noux-pkg/bash/home_end_delete.patch PATCH_OPT := -p1 -d src/noux-pkg/bash diff --git a/repos/ports/src/noux-pkg/bash/home_end.patch b/repos/ports/src/noux-pkg/bash/home_end_delete.patch similarity index 61% rename from repos/ports/src/noux-pkg/bash/home_end.patch rename to repos/ports/src/noux-pkg/bash/home_end_delete.patch index 796860d109..c45531deed 100644 --- a/repos/ports/src/noux-pkg/bash/home_end.patch +++ b/repos/ports/src/noux-pkg/bash/home_end_delete.patch @@ -1,17 +1,20 @@ -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: +This patch adjust the default encoding for the home, end, and delete keys to +match the 'screen' terminal as used by Genode. It is related to the following +issues: - https://github.com/genodelabs/genode/issues/2705 + https://github.com/genodelabs/genode/issues/2705 (home, end) + https://github.com/genodelabs/genode/issues/4058 (delete) --- a/lib/readline/readline.c +++ b/lib/readline/readline.c -@@ -1293,8 +1293,8 @@ +@@ -1293,8 +1293,9 @@ 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[3~", rl_delete); + rl_bind_keyseq_if_unbound ("\033[4~", rl_end_of_line); #if defined (__MINGW32__)