Skip to content

fix(terminal): encode Ctrl+<char> as the xterm control byte (#88) - #90

Merged
chi11321 merged 1 commit into
devfrom
fix/terminal-control-bytes
Nov 15, 2026
Merged

chi11321 merged 1 commit into
devfrom
fix/terminal-control-bytes

Conversation

@chi11321

Copy link
Copy Markdown
Owner

Keys with Ctrl held that no binding covers fell through to nothing: gpui leaves key_char unset whenever Ctrl is held, and reports the shifted character as the key name with shift cleared, so Ctrl+Shift+- arrives as key = "" — a name no binding matched, and the IME path never sees control keydowns. nano's go-to-line (^) was unreachable.

Map the key name through the xterm control table as a fallback after binding resolution (a-z -> 0x01..0x1a, @ [ \ ] ^ _ -> 0x00..0x1f, ? -> 0x7f); undefined keys (-, /, digits) still fall through unchanged, and an active IME composition is never intercepted.

Keys with Ctrl held that no binding covers fell through to nothing: gpui
leaves key_char unset whenever Ctrl is held, and reports the shifted
character as the key name with shift cleared, so Ctrl+Shift+- arrives as
key = "_" — a name no binding matched, and the IME path never sees control
keydowns. nano's go-to-line (^_) was unreachable.

Map the key name through the xterm control table as a fallback after
binding resolution (a-z -> 0x01..0x1a, @ [ \ ] ^ _ -> 0x00..0x1f, ? ->
0x7f); undefined keys (-, /, digits) still fall through unchanged, and an
active IME composition is never intercepted.
@chi11321
chi11321 merged commit 95ced0e into dev Nov 15, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants