From 46ce8a1d2f31d2c41f5c83ad6e67eb5fe46f9115 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 20 Sep 2025 09:12:55 +0200 Subject: [PATCH] Fix regression breaking self-insert of kitty shifted codepoint Commit 50a6e486a56 (Allow explicit shift modifier for non-ASCII letters, fix capslock behavior, 2025-03-30) delayed handling of kitty keyboard protocol's shifted codepoints. It does handle shifted codepoints when matching keys to mappings; but it fails to handle them in the self-insert code paths where we want to insert the text represented by CharEvent::Key. Fix it by resolving the shifted key. Fixes #11813 (cherry picked from commit bb916f8d73c9e35b578baf62e260435e13253aba) --- CHANGELOG.rst | 7 +++++++ src/input_common.rs | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a209cde83..1d9107535 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,10 @@ +fish 4.0.9 (released ???) +========================= + +This release fixes a regression in 4.0.6 that caused shifted keys to not be inserted on some terminals. + +-------------- + fish 4.0.8 (released September 18, 2025) ======================================== diff --git a/src/input_common.rs b/src/input_common.rs index 4f3d88ba1..188bce239 100644 --- a/src/input_common.rs +++ b/src/input_common.rs @@ -171,10 +171,15 @@ pub fn from_single_byte(c: u8) -> Self { } pub(crate) fn codepoint_text(&self) -> Option { - if self.modifiers.is_some() { + let mut modifiers = self.modifiers; + let mut c = self.codepoint; + if self.shifted_codepoint != '\0' && modifiers.shift { + modifiers.shift = false; + c = self.shifted_codepoint; + } + if modifiers.is_some() { return None; } - let c = self.codepoint; if c == key::Space { return Some(' '); }