Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1290196ybb; Fri, 29 Mar 2019 01:16:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7oojMgh4t1wyhPswTRBC8JlF953fkvX1mXJkT77Wk+SLwaB2uYzF2Ls2NXbFI1EvlEir1 X-Received: by 2002:a62:2fc4:: with SMTP id v187mr47368106pfv.147.1553847413421; Fri, 29 Mar 2019 01:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553847413; cv=none; d=google.com; s=arc-20160816; b=dpZf5tdrIdMb/fhKHgVI1X/Waj1Od5BFfbTxvQQ6aB8zowlTU5YDYLgMmlPwAN0GdU QEIo4pmC7p6b0YgAj8Peskcdeg5LgPDSYchxWBKFGILSxbJzXd/CQk7N4HxX1DBfTFbI A31LCum1BkKdsiuY834jpsNcWckqPPF41DNI6igsWq8VPFSQzoxMyWPBDJ6OLIOkShno CHvI9aESgMBXCy1VJV5C4xD0vpqKzjLaM+Nw/zoQ5BEn4luI64XgPYDuH4Rw604weO4L qwt7GZtTaEQhP1Mc5DyeB2rOcMyGfHk/2a9nHWjpWaD15yjO99UrbrJOepO2gkydB1Rt rIEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cTZwErMy/6ShUmeZ7S5k9yA7EQi480v9XQtsikB0Iyk=; b=IktekcJ/R/zuA5pcbigzuxlObNEFzCoMr185fi558VLABtJE3szVxoXH869l5PuIAf Frnv/mI7AUizX6/BJBsiV4aw6yEhLZdL3WL1hOIJheqkboeXQ1m7Rqlv5Qe6rUVvNfHl K1kpKuOCpSb7JZoNnQWkHd7olRD/y61QJoOuAz+xktTrCx50McgAlSVpv0mZBYj6l3wr 4rhpzwj0F03nZt8bIX+4SBQFsyqv5179PCADetvIrSxmdLoG0Y9mao2+XwqD8qhDLLUR Rs3vYy4nrEDDEHjZbYRym8cw9EtIF/5PNgqRQwmsBq7V43r6+Kob27jkcJmB+TwF22kz NcbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W+lq4tE3; 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 q61si1413224plb.245.2019.03.29.01.16.37; Fri, 29 Mar 2019 01:16:53 -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=W+lq4tE3; 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 S1729024AbfC2IQD (ORCPT + 99 others); Fri, 29 Mar 2019 04:16:03 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35044 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbfC2IQD (ORCPT ); Fri, 29 Mar 2019 04:16:03 -0400 Received: by mail-pg1-f193.google.com with SMTP id g8so851290pgf.2; Fri, 29 Mar 2019 01:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cTZwErMy/6ShUmeZ7S5k9yA7EQi480v9XQtsikB0Iyk=; b=W+lq4tE3YCjD1U52oRDyw0MITmhs+JG37iEPbBOYYWnLNS7rw+007GeaP97To0ALve 5a59trA+XOpzFum/LO+uIHb3TO4/jgJFpHJPIjzP5bzR4vVQDHDkatNsQ0gVgIqkjw7p SILeRRq4UNFhzFd4spUDKsjR7StsjIjhqfAeQrgvsOVbdCZBBRPNTePmKQCR4dfeO3rl ecDlPtmpYenyBmsstmzszzPmSToyR5hDfcBW69h5Poq2DvyYkLWwH3p4UqbegK3Hkrc/ AmR2rmjJqsgMVd7zyTITpAH9KhZJp6sBJu3S1HAAVDxVDNNJSeZJuUjb1sloQNoAP0Ge qx6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cTZwErMy/6ShUmeZ7S5k9yA7EQi480v9XQtsikB0Iyk=; b=pl+DINtArE2vhcZXxTZP9GHlDSYRguUpZXTgKLTA+qYJb5LhFFK0zxov/qs46/Yo+h XiPPxyTx4jKfET84wj0a6yDonD4QCZlVxqKt/hBSDpFlfLhZqFbQuW9qhiSbG8oD8tLv HWRr+Nj9MJ11tWRsgrJyxsUYavM8VvCaHHL8BKTgv0t6fM9SMVl/ouOuAL43L1bKZCms AQuKSrF2SfT1x/Pd7uCi7UROxJr3muMLZBgppwGHI5t/xVXES9Ix38N9ls1WJddvfJAA c1qvHUu9k4f38AK64vhnQVzi04PahVmGQHLZuEufmq2OJhmsTIFhumSbPf5WJoonsmAG z/mg== X-Gm-Message-State: APjAAAWmLvY39BATHFmxOnnfdemOt809o6Jj/eT4NnN5MdnI4gZC+KMW aUGpBUBAZHddghUlg8nTUnY= X-Received: by 2002:aa7:8719:: with SMTP id b25mr45884459pfo.90.1553847362300; Fri, 29 Mar 2019 01:16:02 -0700 (PDT) Received: from mail.google.com ([104.238.181.70]) by smtp.gmail.com with ESMTPSA id c3sm1923288pfo.2.2019.03.29.01.16.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 01:16:01 -0700 (PDT) Date: Fri, 29 Mar 2019 08:15:59 +0000 From: Changbin Du To: Masahiro Yamada Cc: Changbin Du , Sam Ravnborg , Linux Kbuild mailing list , Linux Kernel Mailing List Subject: Re: [PATCH] kconfig/[mn]conf: handle backspace (^H) key Message-ID: <20190329081558.u54hczsjheacwvtk@mail.google.com> References: <20190325151647.11581-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-508-7c9a6d 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 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. > > > > > 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