Re: [PATCH 0/3] vt: add modifier support to cursor and navigation keys

From: Greg Kroah-Hartman

Date: Sun Feb 08 2026 - 10:28:23 EST


On Mon, Feb 02, 2026 at 11:52:45PM -0500, Nicolas Pitre wrote:
> This series adds xterm-style modifier encoding to cursor keys and navigation
> keys on the Linux console.
>
> Modern terminal applications (shells, editors, TUI programs) rely on
> modifier+key combinations like Ctrl+Left, Shift+Home, or Alt+Delete for
> navigation and selection. The xterm protocol encodes these as CSI sequences
> with a modifier parameter (e.g., ESC [ 1 ; 5 D for Ctrl+Left).
>
> While the existing func string table mechanism could technically support
> these sequences, each modifier combination would require a separate entry,
> quickly exhausting the limited string table space. This series instead
> generates the sequences programmatically, providing full modifier support
> without consuming string table entries.
>
> This series addresses that in three patches:
>
> 1. Add modifier encoding to cursor keys (Up/Down/Left/Right). When
> Shift, Alt, or Ctrl are held, the arrow keys now emit sequences like
> ESC [ 1 ; 2 A instead of plain ESC [ A.
>
> 2. Add a new KT_CSI keysym type for navigation keys (Home, End, Insert,
> Delete, PgUp, PgDn) and function keys. These generate CSI tilde
> sequences (ESC [ n ~) with automatic modifier encoding.
>
> 3. Add automatic fallback to the plain keymap for modifier-aware key
> types. This eliminates the need for explicit bindings for each
> modifier combination - a single plain keymap entry handles all
> modifier variants.
>
> The modifier encoding follows the standard xterm convention:
> mod = 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0)
>
> Explicit keymap bindings take precedence, preserving backward
> compatibility with existing configurations.
>
> Corresponding patches for the kbd package (loadkeys/dumpkeys) are ready
> and will be submitted once this kernel support is available.
>
> diffstat:
> drivers/tty/vt/keyboard.c | 80 ++++++++++++++++++++++++++++++++--
> include/uapi/linux/keyboard.h | 29 +++++++++++++
> 2 files changed, 103 insertions(+), 6 deletions(-)
>
>

Argh, sorry, I saw this patch series too late for this merge window.
I'll review it after -rc1 is out.

thanks,

greg k-h