From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel,gmane.comp.lib.ncurses.bugs Subject: Re: Emacs difficulties in linux console with ncurses-6.3 caused by kcbt=\E^I. Date: Sat, 7 May 2022 14:35:06 +0000 Message-ID: References: <20220506000102.GA10144@prl-debianold-64.jexium-island.net> <83v8uizd6r.fsf@gnu.org> <83y1zdy61z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39969"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dickey@his.com, bug-ncurses@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 07 16:37:29 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nnLYn-000AEE-6V for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 16:37:29 +0200 Original-Received: from localhost ([::1]:58104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnLYl-000420-TC for ged-emacs-devel@m.gmane-mx.org; Sat, 07 May 2022 10:37:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnLWa-0002Uc-Lr for emacs-devel@gnu.org; Sat, 07 May 2022 10:35:12 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:35124 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1nnLWX-0006n3-Io for emacs-devel@gnu.org; Sat, 07 May 2022 10:35:12 -0400 Original-Received: (qmail 51052 invoked by uid 3782); 7 May 2022 14:35:06 -0000 Original-Received: from acm.muc.de (p2e5d55ed.dip0.t-ipconnect.de [46.93.85.237]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 07 May 2022 16:35:06 +0200 Original-Received: (qmail 25603 invoked by uid 1000); 7 May 2022 14:35:06 -0000 Content-Disposition: inline In-Reply-To: <83y1zdy61z.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289398 gmane.comp.lib.ncurses.bugs:8548 Archived-At: Hello, Eli. On Sat, May 07, 2022 at 13:45:44 +0300, Eli Zaretskii wrote: > > Date: Sat, 7 May 2022 10:41:46 +0000 > > Cc: dickey@his.com, bug-ncurses@gnu.org, emacs-devel@gnu.org > > From: Alan Mackenzie > > > I'm not against that, I'm against doing that in term.c for all the > > > text-mode terminals. > > I misunderstood you, there, sorry. I'd misunderstood the code, and I > > thought (without thinking) that the translation functionality for > > terminfo settings would be buried deep in the C code, somewhere. > Some of it is, actually. But users can countermand at least some of > that code in their customizations. Which is most helpful, here. > > > You could, for example, modify input-decode-map in lisp/term/linux.el, > > > and that would be OK with me, if there's no better solution for this. > > That's the bit I missed - that the pertinent translation into 'backtab > > is done by the input-decode-map. So, as you say, all that is needed is > > to remove the binding from that keymap. I'll take back what > > I said about the problem being difficult to fix. > > Maybe we can write an entry in PROBLEMS and leave it to the user to fix > > in her .emacs. Or maybe we can put code in lisp/term/linux.el > > ourselves. > I'm okay with both alternatives, since I have no opinion on what is > more important to users of Emacs on the Linux console. Having thought about it, I think putting (define-key input-decode-map "\e\t" nil) into lisp/term/linux.el would be the best thing. It will restore Emacs on the Linux console to what it was before the recent ncurses release. > > I don't know how typical I am of Linux console users, but I have my > > keymap set up to send a different code for - namely > > "\033[4}\011". > Perhaps that PROBLEMS entry could suggest that as well, so that users > could have the cake and eat it, too. Here's a first stab at the PROBLEMS entry, under * Runtime problems on character terminals>: ** The shift tab key combination works as meta tab on a Linux console. This happens because on your keyboard layout, S-Tab produces the same keycodes as typing Esc Tab individually. The best way to solve this is to modify your keyboard layout to produce different codes, and tell Emacs what these new codes mean. The current keyboard layout will probably be a .map.gz file somewhere under /usr/share/keymaps. Identify this file, possibly from a system initialization file such as /etc/conf.d/keymaps. Run gunzip on it to decompress it, and amend the entries for keycode 15 to look something like this: keycode 15 = Tab alt keycode 15 = Meta_Tab shift keycode 15 = F219 string F219 = "\033[4}\011" # Shift+ After possibly saving this file under a different name, compress it again using gzip. Amend /etc/conf.d/keyamps, etc., if needed. Further details can be found in the man page for loadkeys. Then add the following line near the start of your site-start.el or ..emacs or init.el file: (define-key input-decode-map "\e[4}\t" 'backtab) > Thanks. -- Alan Mackenzie (Nuremberg, Germany).