Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3337141img; Mon, 25 Mar 2019 08:18:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGsjzR/92Lgh96gSvXbkfVVyJrubytYSUJAxAV7wHbWsr02qETpoy/XEVQotvF2msRl/TD X-Received: by 2002:a65:420b:: with SMTP id c11mr2524689pgq.24.1553527097643; Mon, 25 Mar 2019 08:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553527097; cv=none; d=google.com; s=arc-20160816; b=WdQ+gtaig1jaloondZIUZrDd4//5pQGQ7/f7hSolafW2/wCta4pO0AhlrKOZPY2kH/ 894dmKWHmeu4uLWJwR4818jIrrM1XaMqyDCFSj5jJmcyEfiTyNDCftn/G1k27Hp1pYfh D6NedBHudDAtJD8PNyK0g5sZxeLiEx0InnTOt/tWBmm83qJtWfSlsL6kJVCnhI+oY+JE VxAiGZRJaUNIYa7u1krcrHBVB+SlW2hqAIayWDh/bizK2NItFk4odbqPr7hPW7OGeRLj M61RH9MzrzB5gUd5SgbQp4r58g6F0dWHSPD/H/n6zblUEwQGmm7enxVVeyM7UVe51i7X qJbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=faTpefi6bfE1Gy0bAl165z7iWn5Zc8VEPB2MEZzT/UA=; b=ouxZEAOLvxa5kDMN6DYBSIdpxexpUjfmGxRMcYX83m3A19bGz//MCeHXGZVuoGw8Fw 85yP92NokzvSuHUQIjnadtrdwKMI5Q0LALFyaeYwqtDz/hfGyddc/2iwN1tJx9JJg16d CD3O821Co/mcMNLYwu3jc9atUb0oZi9EWZSc8IyCuXSc7SuqEKhfbYS/yIsphILiRYOR n5evsMWedOLX81MYTkLIDAGB231eMwdTgBTLoc5kgev/jgnt36BBuX17rAhUnuQ6ILMq iLrwDqEbRJbr6Axf9vUCWoS/8jMEL+MMi5N7NtZu3QsNSyWn0h0B2akGCFIPRATaI2pq pUUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HNQrZ5zf; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h127si13420044pgc.407.2019.03.25.08.18.02; Mon, 25 Mar 2019 08:18:17 -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=@gmail.com header.s=20161025 header.b=HNQrZ5zf; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727145AbfCYPQx (ORCPT + 99 others); Mon, 25 Mar 2019 11:16:53 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33598 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfCYPQw (ORCPT ); Mon, 25 Mar 2019 11:16:52 -0400 Received: by mail-pf1-f194.google.com with SMTP id i19so6609372pfd.0; Mon, 25 Mar 2019 08:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=faTpefi6bfE1Gy0bAl165z7iWn5Zc8VEPB2MEZzT/UA=; b=HNQrZ5zfEkiRkdncHiE7Xeb6mSgFB5dUVk3rE6RxUrkBz7mW7Qu651MRJ8xupugVqg F21NjyuQ6lmZQbeL0mPbsoBGRxIQZNiWRvQhzEgVdURGTwKMpPzpklzSvF9qQmfxPVfK zbk7LclusXEFx3S5/p70FW5ftkT8cITxeqa5nA86TS1EniFIr9N9KuaP47WIE/Zzu8tt FvblGk/jnZfU9OfJ5ko2IBAKS0hwsT4ftT7PUjYZfXe9HVorjDyka9Q/wENezaSF/7cn AkO0hxmLEJdPcJVQI5UwoPsCWTNRAcT34nvvgxpuPex+QYpmC+2a5h75cfL1GE/rEhQe YSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=faTpefi6bfE1Gy0bAl165z7iWn5Zc8VEPB2MEZzT/UA=; b=ic7flZUBr0q9omXh+sEl9Pnzkq9GP9i8GFLs/MsLFTDmAczZ8S/DmmEMqoBoeE+7d9 HPqDp9zmptHd4bk9fhh0WgG8yRsoQl6pbEnrwYVEzO1LPp/ZHe81kQO3q+IF77tW8uUP wlLFlqLY4XhYv4dtN/OagR0PjMM3hzABg0gEL+6oTvVOEHW2hm/mCzXpNv605sZ2hyUw v1ZZfzNA7W7Jq8GHZAEg8ElvZWMExEMye2qcRTp02A375NxnvVSRGYILgOrxYaa3A+H0 Gbto8OoaOkv8mLqgUu9jNYd0dKRMFOP2WIyB7H3QfRnVkpLN78qJUJhvS7+KpCeS2ww3 Ge9w== X-Gm-Message-State: APjAAAWuPf7S20+ikR4tot9dgH1QWmyfkbhhJ+53s6xJOae1IMQ5wcXf sOwaB21Fop/LEjDi6aENMy0= X-Received: by 2002:a62:e911:: with SMTP id j17mr24527336pfh.107.1553527011777; Mon, 25 Mar 2019 08:16:51 -0700 (PDT) Received: from vultr.guest ([104.238.181.70]) by smtp.gmail.com with ESMTPSA id a7sm19776728pfc.45.2019.03.25.08.16.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 08:16:51 -0700 (PDT) From: Changbin Du To: Masahiro Yamada Cc: sam@ravnborg.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH] kconfig/[mn]conf: handle backspace (^H) key Date: Mon, 25 Mar 2019 15:16:47 +0000 Message-Id: <20190325151647.11581-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 611945611bf8..1dcfb288ee63 100644 --- a/scripts/kconfig/lxdialog/inputbox.c +++ b/scripts/kconfig/lxdialog/inputbox.c @@ -113,7 +113,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 a4670f4e825a..ac92c0ded6c5 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -1048,7 +1048,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 7be620a1fcdb..77f525a8617c 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.17.1