a73x

Wire ghostty input.encodeKey for non-text keys

closed   by a73x

Labels: review

Arrow keys, function keys, Home/End/PageUp/PageDown, and other keys that xkbcommon doesn't emit UTF-8 for are currently silently dropped.

Fix: in the main loop keyboard dispatch path (src/main.zig runTerminal), when ev.utf8_len == 0, call ghostty_vt.input.encodeKey(&buf, key_event, opts) and write the encoded bytes to the PTY instead of skipping.

Requires:
- Constructing a ghostty_vt.input.KeyEvent from the KeyboardEvent (keysym -> ghostty Key enum mapping)
- Constructing KeyEncodeOptions from the current terminal modes (via ghostty_vt.input.KeyEncodeOptions or equivalent — check the ghostty-vt example)

Affects vim, tmux, htop navigation, any full-screen TUI.

Close reason: Fixed by patch f3d39237

Comments

a73x   2026-04-08T11:09:09.187525871+00:00

[claude 2026-04-08] Picking this up. Plan: add a tested non-text key encoding path using ghostty-vt input.encodeKey, then wire runTerminal keyboard dispatch to send encoded bytes for arrows, function keys, and navigation keys.

a73x   2026-04-08T11:19:09.523100613+00:00

[claude 2026-04-08] Local fix is in place and verified with . Added a vt encodeKey wrapper, mapped Wayland keysyms for arrows/Home/End/PageUp/PageDown/Insert/Delete/F1-F12, and wired non-text keyboard events through the PTY path when UTF-8 is empty.

a73x   2026-04-08T11:38:16.573137852+00:00

[claude 2026-04-08] Committed locally as 3d5b717 (). Moving on to the next issue while this sits ready for patch/review.