Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2971553yba; Mon, 22 Apr 2019 16:54:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoFaSy5J8xBV0XvkBrqPL9FtS0FOY3ZKN6LbaxRoZDIx2P+F85lYIOWQp7/0DrHVfM715q X-Received: by 2002:a62:4602:: with SMTP id t2mr23475673pfa.26.1555977290385; Mon, 22 Apr 2019 16:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555977290; cv=none; d=google.com; s=arc-20160816; b=mIP1RdkdM6uAe4q6vQyKbd/6mh10yw/4CDi5dYAPr0hFMiPVPDePAT/dZU/ulwEbXn 17zlxjscnk79w78WTRVS90kBgueoc053L+2sLZC8XoYWbdr+Fh4PHkMpHME30e/NKyib P2pfVKrV+KP4nA7Uv2kX1oTQwfMzhhmVg3DYeoqEN4FEVQNOrCunuc89D5jhwO/oN9rg sklFpK37k5V+N8MAL2Y5kUQc7nW+eeBG0HPx21u2pmvaKntR2LvWhyUCuZ1rhJEHf8Bk 4KCPK3nsoWGief6QALmdnDbhwdKEYUm8+8Dp2/+NFmmsbKoH9Gbj0RSsWf5xnI+KIs3W lhwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2+KClVep9ZDsM7jnHYDab1AmKMRyldMX4SYs3/NGofM=; b=tufoS5H/EZQPj20XwgQfKD9nqiVskwKxyQ/gpmFVjmYZSIdSBVstBV7Qg1/tzXvCK9 jO+S39fVN7RN/pZQiLdaO6oWOnv02QaacCfzVR6SOq5RgR4vuP0KPm3HeZz4Mn7RgGUs /7Tg6hjzXefY/VSEAdTJqQ8Xs4ETZOg/8OFvWYqOkQ2E6baQyGrSHToRu6dh44NmJmU7 Wo590Gjl5HmIhGoBLI7ElataftU6JFRjL1CRBigH2nvb6wqwQS/ALLNc6HaUJf9JNKe7 hNFSsxNAYMVgefz/tAYLLw7OqUITAPg7pd7xiLRWXXWdvgfNX4GLGiqRWas0ZPK+Jom6 Y42w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XTV1RQjQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si14647393pfa.163.2019.04.22.16.54.35; Mon, 22 Apr 2019 16:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XTV1RQjQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731899AbfDVUA2 (ORCPT + 99 others); Mon, 22 Apr 2019 16:00:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:50072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730203AbfDVTrU (ORCPT ); Mon, 22 Apr 2019 15:47:20 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1698218FE; Mon, 22 Apr 2019 19:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962439; bh=sUnldtxpnuJZ8MvWVHISfTFRFf77HXIStKLovvdd2vY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XTV1RQjQz3kDWhidiV8SO8OJSsr1haQeDij78bu6TqAdVe/oMhamUptRIvwi1CNAF ep/F+r8oDImIEKJPQ5ENOMV9Ka0/tUOhjWpJRXzIfu3JsMjWcqvTDp9H+k/uyeGCKU UaGlRRMWb3riO9xkdi0XMA8cX3VoGffXFNkQTrM8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Changbin Du , Masahiro Yamada , Sasha Levin , linux-kbuild@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 64/68] kconfig/[mn]conf: handle backspace (^H) key Date: Mon, 22 Apr 2019 15:45:12 -0400 Message-Id: <20190422194516.11634-64-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changbin Du [ 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 Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin (Microsoft) --- 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 fe82ff6d744e..b15c8d1744f5 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 1ef232ae5ab9..c8ff1c99dd5c 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -1049,7 +1049,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 88874acfda36..820fc9256532 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c @@ -440,7 +440,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