From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Changbin Du <changbin.du@gmail.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Sasha Levin <sashal@kernel.org>,
linux-kbuild@vger.kernel.org
Subject: [PATCH AUTOSEL 3.18 15/15] kconfig/[mn]conf: handle backspace (^H) key
Date: Mon, 22 Apr 2019 15:50:22 -0400 [thread overview]
Message-ID: <20190422195022.13760-15-sashal@kernel.org> (raw)
In-Reply-To: <20190422195022.13760-1-sashal@kernel.org>
From: Changbin Du <changbin.du@gmail.com>
[ Upstream commit 9c38f1f044080392603c497ecca4d7d09876ff99 ]
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: Changbin Du <changbin.du@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
---
scripts/kconfig/lxdialog/inputbox.c | 3 ++-
scripts/kconfig/nconf.c | 2 +-
scripts/kconfig/nconf.gui.c | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index d58de1dc5360..510049a7bd1d 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -126,7 +126,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
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) {
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 984489ef2b46..e570f6c9b3ad 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -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
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 4b2f44c20caf..9a65035cf787 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -439,7 +439,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],
--
2.19.1
prev parent reply other threads:[~2019-04-22 19:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 19:50 [PATCH AUTOSEL 3.18 01/15] qlcnic: Avoid potential NULL pointer dereference Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 02/15] usb: gadget: net2280: Fix overrun of OUT messages Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 03/15] usb: gadget: net2272: Fix net2272_dequeue() Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 04/15] net: ks8851: Dequeue RX packets explicitly Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 05/15] net: ks8851: Reassert reset pin if chip ID check fails Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 06/15] net: ks8851: Delay requesting IRQ until opened Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 07/15] net: ks8851: Set initial carrier state to down Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 08/15] net: ibm: fix possible object reference leak Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 09/15] scsi: qla4xxx: fix a potential NULL pointer dereference Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 10/15] usb: u132-hcd: fix resource leak Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 11/15] tty: fix NULL pointer issue when tty_port ops is not set Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 12/15] ceph: fix use-after-free on symlink traversal Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 13/15] scsi: zfcp: reduce flood of fcrscn1 trace records on multi-element RSCN Sasha Levin
2019-04-22 19:50 ` [PATCH AUTOSEL 3.18 14/15] libata: fix using DMA buffers on stack Sasha Levin
2019-04-22 19:50 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190422195022.13760-15-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=changbin.du@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome