lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260203045457.1049793-1-nico@fluxnic.net>
Date: Mon,  2 Feb 2026 23:52:45 -0500
From: Nicolas Pitre <nico@...xnic.net>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jirislaby@...nel.org>,
	Alexey Gladkov <legion@...nel.org>
Cc: Nicolas Pitre <npitre@...libre.com>,
	linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 0/3] vt: add modifier support to cursor and navigation keys

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ