emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs difficulties in linux console with ncurses-6.3 caused by kcbt=


From: Alan Mackenzie
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

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 <acm@muc.de>

> > > 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 <esc><tab> 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 <shift><tab> - 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+<tab>

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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]