Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1554605ybb; Fri, 29 Mar 2019 06:51:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJpdIdh7Qr1E0xFijmQ9tgWGXzAyXwav/0cfK0kwr3c+xlS69V5fx1QmEjmJxAkPa8Wz0T X-Received: by 2002:a62:76c1:: with SMTP id r184mr12643665pfc.229.1553867519246; Fri, 29 Mar 2019 06:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553867519; cv=none; d=google.com; s=arc-20160816; b=T9lnKOoXi4xVPgVqWLmd+uI1y88r9IHXgpSP9jRut3G47yGyNjVAIWuzx5W8ccC5sI ArQ1Xo5ML+dXYPzCjRFTr/yFfaTB2ZIFTpedo/KJeYdV24hzesTqBo14Q/eLGH1RjAJd C1uZkcKA8I40/JiKdKrig9bF7f4maxKrEtsfilM55a6oS9RneJMsp3ucJxB4+zCG3ME3 XXC36yn4u9/H/M2VhhOWCvmONGqgg8wupd6Mv+mSp06sqvy4pgey5kAJ+ab9SLiDQB5a V/tZlLAIkpId7pABdBbfWoKi0HAXDV6x8kbzpmEg5+ei1gHELUtvxWH6wCLcsIPQr5Q4 jF8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=z07dstaWaASY9Xr9tFB5a3Sy7OXdHBbB/QFb0ZKL+5Q=; b=HjM/whJTIP7VYSRiGE2tfzd2vzIz+ppSqE2b9Wp4Y3FmG04Bwp6rkoXEaQtBxEnzJg hYLrMUIKcKz95gU4hZzWSu65HhfLE611dXaqp4dAmpTbmr8iC+kSviDBACSH4HXotGDG 56Bopzk/CCPH9MdMCvznBUt4/D2OKPviZz7t92ECViSVwYiYYXlzsMUioXfnUnrPbaDl DHp1rr7WXrdNm7rhAbT81wGPzwxon2Irz8A0L/M136LyQs1QRRAFrhsxzjhgMkq2CZ/W Dq6aNQx5mGjQb4WznEqPfb5ToNa5qHKq0WwsYy/OVasOJf5Yj6R/JBvogabnC4Sb4tNN n7XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oQ6DqanQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb11si1964584plb.420.2019.03.29.06.51.42; Fri, 29 Mar 2019 06:51:59 -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=@nifty.com header.s=dec2015msa header.b=oQ6DqanQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729719AbfC2NvH (ORCPT + 99 others); Fri, 29 Mar 2019 09:51:07 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:21542 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729639AbfC2NvH (ORCPT ); Fri, 29 Mar 2019 09:51:07 -0400 Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x2TDofYT028644; Fri, 29 Mar 2019 22:50:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x2TDofYT028644 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553867442; bh=z07dstaWaASY9Xr9tFB5a3Sy7OXdHBbB/QFb0ZKL+5Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oQ6DqanQuwRMxvpEiKoE7e8P4STQmFYuZTj4W5I9Om2g/Xlr0kwmvvdIYqPzj1lX7 Xqk3s3AzqVTS6cfp4xJ3O5T2Q3VS/9m12B2ljM7ACdfKqIGLR7hEHH/XVi+12aOJWm x6GoYxNd0xOUgqxF1HtSuENYCvjxxF6vwlGQRrgA4Cwt83bd/5D1ZKTxUTNVk1lUa4 7Y2DhreDZCwuCRvWoJbEeSw/6LMCNFHQzhJOL9YWC8N0MlBOVW3NkHaF7QFe7Dz3h5 hquoDM9607EIsxSG159wOtbP0UYGfjKd5bxnsRXBKYa0h3cfDVwjah0W5dXZv+NEll aI+6Vnhf+o53g== X-Nifty-SrcIP: [209.85.222.52] Received: by mail-ua1-f52.google.com with SMTP id f88so686879uaf.2; Fri, 29 Mar 2019 06:50:41 -0700 (PDT) X-Gm-Message-State: APjAAAVixeUqqhIENyw55YMPjE1mSi4LpcJHXMXXZqyEg2Fbzr1Aa+jb FRAO96+WUfg0ZHCZGDsGC59cyYe9sX/yLIXBi8o= X-Received: by 2002:ab0:3058:: with SMTP id x24mr17778681ual.95.1553867440537; Fri, 29 Mar 2019 06:50:40 -0700 (PDT) MIME-Version: 1.0 References: <20190325151647.11581-1-changbin.du@gmail.com> <20190329081558.u54hczsjheacwvtk@mail.google.com> In-Reply-To: <20190329081558.u54hczsjheacwvtk@mail.google.com> From: Masahiro Yamada Date: Fri, 29 Mar 2019 22:50:04 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kconfig/[mn]conf: handle backspace (^H) key To: Changbin Du Cc: Sam Ravnborg , Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 29, 2019 at 5:16 PM Changbin Du wrote: > > On Fri, Mar 29, 2019 at 04:50:18PM +0900, Masahiro Yamada wrote: > > On Tue, Mar 26, 2019 at 12:16 AM Changbin Du wrote: > > > > > > 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. > > > > > > > > Shall I fix '$?' to '^?' > > if it is a typo? > > > yes, please. It is a typo, sorry. > Fixed the typo, and applied to linux-kbuild/fixes. Thanks. > > > > > > > > > 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 > > > > > > > > > -- > > Best Regards > > Masahiro Yamada > > -- > Cheers, > Changbin Du -- Best Regards Masahiro Yamada