[PATCH 0/3] support for the kernel 7.1 modifier-aware KT_CSI keysym type
Nicolas Pitre <[email protected]> Thu, 11 Jun 2026 21:48:54 -0400
| Newsgroups | dev.linux.lists.kbd |
|---|---|
| Message-ID | <[email protected]> |
Linux kernel 7.1 introduces modifier-aware escape sequence generation
for the console keyboard:
4af70f151671 ("vt: add modifier support to cursor keys")
5cba06c71c71 ("vt: add KT_CSI keysym type for modifier-aware CSI sequences")
c1d2deb6492f ("vt: add fallback to plain map for modifier-aware key types")
The new KT_CSI keysym type produces xterm-style CSI tilde sequences
(ESC [ n ~, or ESC [ n ; mod ~ when Shift/Alt/Control are held) with
the modifier state encoded at runtime. A single plain map entry covers
all modifier combinations, instead of consuming a func_table string
slot per combination. These changes are in Linus's tree and part of
the 7.1 release.
This series adds the userspace counterpart:
Patch 1 teaches libkeymap the Csi_* keysym names (Csi_Home, Csi_End,
Csi_Delete, Csi_Insert, Csi_PgUp, Csi_PgDn, Csi_F1..Csi_F20, matching
the kernel UAPI values) and documents modifier-aware keys in
keymaps(5).
Patch 2 adds a contrib script (with optional systemd unit) that
reconciles the "linux" terminfo entry with the loaded keymap: F1-F5
in CSI form and Backtab as ESC [ Z are not what the stock terminfo
entry expects. The script rebuilds an /etc/terminfo override from the
distribution's pristine entry and tags it with a marker so it never
touches an administrator-provided override.
Patch 3 converts the shared i386 keymap include files to the new
keysyms. Legacy copies of the include files are preserved for systems
running older kernels. On a pre-7.1 kernel the new keysyms load
without effect on Unicode-mode consoles, so function and navigation
keys would be inert there; the legacy includes retain the historical
behavior.
Tested with make check, and the terminfo script exercised live
(keymap loading, override creation/idempotence/removal, restoration)
on Fedora 43.
Nicolas Pitre (3):
libkeymap: add support for KT_CSI keysym type
Add kbd-terminfo-fixup script and systemd service
keymaps: convert include files to use CSI keysyms
.gitignore | 1 +
Makefile.am | 16 ++
configure.ac | 18 ++
contrib/kbd-terminfo-fixup | 222 ++++++++++++++++++
contrib/kbd-terminfo-fixup.service.in | 13 +
.../i386/include/linux-keys-bare-legacy.inc | 170 ++++++++++++++
data/keymaps/i386/include/linux-keys-bare.inc | 76 ++----
.../i386/include/linux-keys-extd-legacy.inc | 37 +++
data/keymaps/i386/include/linux-keys-extd.inc | 23 +-
.../linux-with-modeshift-altgr-legacy.inc | 101 ++++++++
.../include/linux-with-modeshift-altgr.inc | 52 ++--
docs/man/man5/keymaps.5 | 77 ++++++
src/libkeymap/ksyms.c | 3 +-
src/libkeymap/syms.ktyp.h | 39 +++
tests/data/keymap0-summary.txt | 26 ++
15 files changed, 770 insertions(+), 104 deletions(-)
create mode 100755 contrib/kbd-terminfo-fixup
create mode 100644 contrib/kbd-terminfo-fixup.service.in
create mode 100644 data/keymaps/i386/include/linux-keys-bare-legacy.inc
create mode 100644 data/keymaps/i386/include/linux-keys-extd-legacy.inc
create mode 100644 data/keymaps/i386/include/linux-with-modeshift-altgr-legacy.inc
--
2.54.0