You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cyrillic Ctrl shortcuts are not recognized by Crossterm consumers despite base-layout reporting #16
Shitty 2026.07.23 when the behavior was originally observed
Linux with a Russian XKB layout
Codex CLI 0.145.0 as the affected terminal application
No terminal multiplexer
Observed behavior
With the Russian layout active, Shitty reports the physical Ctrl+C and Ctrl+D keys as Kitty CSI-u events containing both the active-layout character and the base-layout character:
physical Ctrl+C: ESC[1089::99;5:1u
physical Ctrl+D: ESC[1074::100;5:1u
The corresponding application receives Ctrl+с and Ctrl+в and does not recognize its ASCII Ctrl+c and Ctrl+d shortcuts. With Kitty keyboard enhancement disabled in the application, the shortcuts work through legacy keyboard encoding.
Protocol context
In the two packets above:
1089 and 1074 are the active Russian-layout characters с and в;
99 and 100 are the base-layout characters c and d;
modifier value 5 represents Ctrl;
event type 1 represents a key press.
The Kitty keyboard protocol defines the unicode-key-code::base-layout-key form and explicitly gives Cyrillic Ctrl+C as a base-layout reporting use case:
Codex 0.145.0 pins Crossterm revision 87db8bfa6dc99427fd3b071681b07fc31c6ce995. That parser reads the primary codepoint but does not retain the third base-layout component, producing Ctrl+с and Ctrl+в from the packets above.
This issue records the terminal-side packets and the interoperability path so the behavior can be checked against future changes in Shitty and its consumers.
Current master status after the native plt refactor:
platform_wayland.cpp still uses xkb_state_key_get_utf32() as layoutCodepoint. With Ctrl active, xkbcommon applies the control transformation, so C/D become codepoints 3/4; baseCodepoint remains 99/100.
vterm.cpp still chooses layoutCodepoint as the Kitty primary key and reports the base-layout key as the alternate field.
The same backend path was reproduced locally with an us,ru keymap:
Ctrl+C: ESC[3::99;5:1u
Ctrl+D: ESC[4::100;5:1u
These packets occur in both layouts, so current master introduces a terminal-side failure before the existing Crossterm base-layout limitation described in this issue. The earlier Cyrillic packets (1089::99 / 1074::100) were protocol-correct; the current C0 primary values are not key identities.
A local regression check separated the two layers:
current-layout level-0 identity: EN 99/100, RU 1089/1074;
base layout: always 99/100;
a compatibility path limited to Kitty alternate-key reporting + Ctrl + printable ASCII base keys passed real Codex CLI 0.145.0 PTY smoke tests for Ctrl+C and Ctrl+D in both EN and RU.
The current frontend tests use identical layout/base values, so they do not exercise either failure.
In my local build, I fixed this with a terminal-side workaround so Ctrl+C and Ctrl+D work in Codex regardless of the active keyboard layout. I made two changes.
1. Key identity and text input in the Wayland/XKB backend
I previously used xkb_state_key_get_utf32() as the current-layout key. Under Ctrl, xkbcommon transforms the result into a control character:
Ctrl+C → 3
Ctrl+D → 4
I now derive the key identity separately:
I read the active-layout key from the active XKB layout at level 0;
I read the base-layout key from layout 0 at level 0;
I use xkb_state_key_get_utf32() only for text input.
This gives me:
Physical key
EN layout
RU layout
Base layout
C
99
1089 (с)
99
D
100
1074 (в)
100
2. Crossterm compatibility path
After fixing the backend, a protocol-correct Russian-layout Ctrl+C packet looks like this:
ESC[1089::99;5:1u
Crossterm ignores the third field (99), so Codex receives Ctrl+с instead of Ctrl+c.
To keep these shortcuts usable, I use the printable ASCII base-layout key as the Kitty primary codepoint when:
the application enabled Kitty alternate-key reporting;
Ctrl is active;
the base-layout key is printable ASCII.
Ctrl+C and Ctrl+D then produce:
ESC[99;5:1u
ESC[100;5:1u
I leave other modifiers, non-ASCII base keys, ordinary text input, and Kitty sessions without alternate-key reporting unchanged.
Activity
ei-grad commentedon Jul 29, 2026
Current
masterstatus after the nativepltrefactor:platform_wayland.cppstill usesxkb_state_key_get_utf32()aslayoutCodepoint. With Ctrl active, xkbcommon applies the control transformation, so C/D become codepoints3/4;baseCodepointremains99/100.vterm.cppstill chooseslayoutCodepointas the Kitty primary key and reports the base-layout key as the alternate field.The same backend path was reproduced locally with an
us,rukeymap:ESC[3::99;5:1uESC[4::100;5:1uThese packets occur in both layouts, so current
masterintroduces a terminal-side failure before the existing Crossterm base-layout limitation described in this issue. The earlier Cyrillic packets (1089::99/1074::100) were protocol-correct; the current C0 primary values are not key identities.A local regression check separated the two layers:
99/100, RU1089/1074;99/100;The current frontend tests use identical layout/base values, so they do not exercise either failure.
Prepared with LM assistance — Codex CLI
ei-grad commentedon Jul 29, 2026
In my local build, I fixed this with a terminal-side workaround so Ctrl+C and Ctrl+D work in Codex regardless of the active keyboard layout. I made two changes.
1. Key identity and text input in the Wayland/XKB backend
I previously used
xkb_state_key_get_utf32()as the current-layout key. Under Ctrl, xkbcommon transforms the result into a control character:34I now derive the key identity separately:
xkb_state_key_get_utf32()only for text input.This gives me:
991089(с)991001074(в)1002. Crossterm compatibility path
After fixing the backend, a protocol-correct Russian-layout Ctrl+C packet looks like this:
Crossterm ignores the third field (
99), so Codex receives Ctrl+с instead of Ctrl+c.To keep these shortcuts usable, I use the printable ASCII base-layout key as the Kitty primary codepoint when:
Ctrl+C and Ctrl+D then produce:
I leave other modifiers, non-ASCII base keys, ordinary text input, and Kitty sessions without alternate-key reporting unchanged.
Prepared with LM assistance — Codex CLI
Add opt-in Kitty Ctrl base-layout mode
pg83 commentedon Aug 4, 2026
Я запилил generic ремапы для клавиатуры, локально это твою боль фиксит, тикет закрываю