kconfig/[mn]conf: handle backspace (^H) key
PATCH 1/1 kconfig/[mn]conf: handle backspace (^H) key
This is in the mainline kernel since v5.1-rc3:9c38f1f04408 ("kconfig/[mn]conf: handle backspace (^H) key")
Quoting the commit's log:
"
Backspace is not working on some terminal emulators which do not send the key code defined by terminfo. Terminals either send '^H' (8) or '^?' (127). But currently only '^?' is handled. Let's also handle '^H' for those terminals.
"
--- scripts/kconfig/lxdialog/inputbox.c | 3 ++- scripts/kconfig/nconf.c | 2 +- scripts/kconfig/nconf.gui.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-)
scripts/kconfig/lxdialog/inputbox.c +2 -1
@@ -113,7 +113,8 @@ do_resize:case KEY_DOWN :break ;case KEY_BACKSPACE : -case 127 : +case 8 :/* ^H */ +case 127 :/* ^? */ if (pos) {wattrset (dialog, dlg.inputbox.atr);if (input_x ==0 ) {
scripts/kconfig/nconf.c +1 -1
@@ -1046,7 +1046,7 @@ static int do_match(int key, struct match_state *state, int *ans) state->match_direction =FIND_NEXT_MATCH_UP ; *ans =get_mext_match (state->pattern, state->match_direction); - }else if (key ==KEY_BACKSPACE || key ==127 ) { + }else if (key ==KEY_BACKSPACE || key ==8 || key ==127 ) { state->pattern[strlen (state->pattern)-1 ] ='\0' ;adj_match_dir (&state->match_direction); }else
scripts/kconfig/nconf.gui.c +2 -1
@@ -435,7 +435,8 @@ int dialog_inputbox(WINDOW *main_window,case KEY_F (F_EXIT ):case KEY_F (F_BACK ):break ; -case 127 : +case 8 :/* ^H */ +case 127 :/* ^? */ case KEY_BACKSPACE :if (cursor_position >0 ) { memmove(&result[cursor_position-1],
---
base-commit: 437ea9f8be5afaebe2d8cbab6242f1182857f21e
change-id: 20260227-kfconfig-backspace-8c53561ae364
Best regards,
Signature · 1 line
Sébastien Szymanski <[email protected]>
Quoted 5 lines · Sébastien Szymanski
This is in the mainline kernel since v5.1-rc3:
9c38f1f04408("kconfig/[mn]conf: handle backspace (^H) key")Quoting the commit's log:
Quoted 8 lines
"
Backspace is not working on some terminal emulators which do not send the key code defined by terminfo. Terminals either send '^H' (8) or '^?' (127). But currently only '^?' is handled. Let's also handle '^H' for those terminals.
"Signed-off-by Sébastien Szymanski <[email protected]>
My only concern here is that we're unintentionally behind on re-syncing scripts/kconfig/ with the Linux kernel, and so unless this is critical I'd like to defer this in favour of a full re-sync (at least up to 6.1 which is where the kbuild side is up to currently).
Signature · 1 line
Tom