Fills out keyboard input per TERMINAL_ROADMAP.md P1: F1–F12,
Home/End, Insert/Delete, PageUp/PageDown, the full Ctrl-A..Z range,
and Alt+key. Arrows / Home / End now respect DECCKM (application-cursor
mode) — emitted as SS3 (ESC O X) when the app enables it, else CSI (ESC [
X). The alt-screen wheel-paging handler uses the same logic so it
matches the app's expectations.
core.rs:
- application_cursor() proxy for vt100's Screen::application_cursor().
component.rs:
- cursor_seq(final_byte, app_cursor) helper: SS3 vs CSI prefix.
- key_to_bytes(key, ctrl, alt, meta, app_cursor) — pure table for the
whole key map, unit-testable without constructing a KeyboardEvent.
F1–F4 SS3, F5–F12 CSI~ (with the real xterm 16/22 gaps), paging keys
always CSI~, Ctrl A..Z → 0x01..0x1a (plus @[\\]^_ variants), Alt+char
→ ESC prefix. map_key_to_terminal_input becomes a thin wrapper.
- handle_keydown reads app_cursor from core_signal before mapping.
- handle_wheel reads app_cursor and uses cursor_seq for arrow paging.
Adds key_to_bytes_table unit test (17 terminal tests total). Clean clippy.
Note: 0x03/0x1a/0x1c (Ctrl-C / Ctrl-Z / Ctrl-\) reach the PTY unchanged
and are interpreted by the shell's stty as SIGINT / SIGTSTP / SIGQUIT —
this is real-terminal behavior (same as xterm / SSH into a real box),
not a bug, and is preserved on purpose.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>