daemon: legacy key encoding drops Ctrl from Space and Backspace and the case after Alt #157
Labels
No labels
Area/ci
Area/cli
Area/client
Area/client-core
Area/daemon
Area/deps
Area/docs
Area/grid
Area/manual
Area/nix
Area/protocol
Area/pty
Area/render
Area/shaping
Area/skills
Area/transport
Area/vt
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Security
Kind/Testing
perf-regression-accepted
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Blocked
Status
Need More Info
Status
Upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
felis-terminal/felis#157
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported on the GitHub mirror: https://github.com/felis-terminal/felis/issues/5
Problem
With no Kitty keyboard flag that turns on CSI u and modifyOtherKeys off, the legacy path in
crates/felis-daemon/src/serve/key_encode.rsencodesends some modified keys differently from xterm and kitty:0x200x000x7f0x08Key::Character("B"))ESC bESC B0x00,0x1b,0x1c,0x1d,0x1e,0x1f,0x7f;/→0x1f,?→0x7fThis is the GUI's own path, so felis users hit it: Emacs
C-SPC(set-mark), readlineM-BvsM-b, and a shell's Ctrl+Backspace word delete all receive a different key.Cause
encode_namedreturns the bare byte forSpaceandBackspacewithout looking at Ctrl, and returnsSome, so the Ctrl branch after it never runs.single_ascii_lower, which exists for the Kitty keycode ("the lowercase ASCII codepoint of the key") and drops the case Shift produced.ctrl_bytemaps letters and@ [ \ ] ^ _but no digits,/or?.Expected
The legacy path matches xterm for these, as it does for the rest:
0x00, Ctrl+Backspace →0x08; Alt prefixesESCas it does for the other named keys.2/@/ Space →0x00,3/[→0x1b,4/\→0x1c,5/]→0x1d,6/^→0x1e,7/_//→0x1f,8/?→0x7f.The modifyOtherKeys and Kitty paths already escape these keys and are unaffected. The legacy section of
docs/reference/protocols/key-encoding.mdshould name the mapping once it is fixed.