Fix regression breaking self-insert of kitty shifted codepoint

Commit 50a6e486a5 (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 bb916f8d73)
This commit is contained in:
Johannes Altmanninger
2025-09-20 09:12:55 +02:00
parent 03ccc88868
commit 46ce8a1d2f
2 changed files with 14 additions and 2 deletions

View File

@@ -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)
========================================

View File

@@ -171,10 +171,15 @@ pub fn from_single_byte(c: u8) -> Self {
}
pub(crate) fn codepoint_text(&self) -> Option<char> {
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(' ');
}