Linux console: don't translate ESC TAB to `backtab' in input-decode-map.

This translation happened after the terminfo entry for <shift>TAB in the linux
section was changed to kcbt=\E^I in ncurses version 6.3.

* lisp/term/linux.el (terminal-init-linux): Add a define-key form to remove
the entry for "\e\t" from input-decode-map.

* etc/PROBLEMS: Add a new section under "character terminals" about S-TAB
wrongly doing the same thing as M-TAB, giving tips about amending the Linux
keyboard layout.
This commit is contained in:
Alan Mackenzie 2022-05-08 11:39:45 +00:00
parent e683b08b3f
commit 1d012e0a62
2 changed files with 31 additions and 0 deletions

View file

@ -1736,6 +1736,33 @@ this, you can remove the X resource or put this in your init file:
(xterm-remove-modify-other-keys)
** 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)
** Emacs spontaneously displays "I-search: " at the bottom of the screen.
This means that Control-S/Control-Q (XON/XOFF) "flow control" is being

View file

@ -17,6 +17,10 @@
(ignore-errors (when gpm-mouse-mode (require 't-mouse) (gpm-mouse-enable)))
;; Don't translate ESC TAB to backtab as directed
;; by ncurses-6.3.
(define-key input-decode-map "\e\t" nil)
;; Make Latin-1 input characters work, too.
;; Meta will continue to work, because the kernel
;; turns that into Escape.