feat(relay): send the page keys herdr refuses as CSI bytes
herdr's key validator has no PageUp, PageDown, Home or End, in any spelling -- re-probed on 0.8.2, where PgUp, pageup, Page_Up and ctrl+Home all answer `unsupported key`. `pane send-text` is a byte channel and passes ESC through verbatim (probed with `cat -v` in a throwaway pane, which showed `^[[5~`), so key_escape_sequence turns those four into the CSI bytes a terminal emits and send_keys ships them that way instead. Clients keep sending the key name. Modified forms are computed rather than enumerated, using xterm's 1 + shift(1) + alt(2) + ctrl(4), so a client cannot compose a chord the relay would have to refuse. A malformed modifier resolves to no sequence at all rather than to the bare key -- silently dropping it would send Home when the client asked for cmd+Home -- and key_is_allowed then refuses it. A mixed keys array keeps its order: runs of one kind travel in one CLI call, so [Escape, PageUp, PageDown, Enter] goes out as send-keys / send-text / send-keys. A run of CSI keys concatenates into the one text argument send-text takes. A failing call in the middle stops the rest and answers with an error, because a half-delivered queue must not report ok. Verified on a throwaway pane: vim moved 1 -> 68 on ESC[6~, to 500 on ESC[1;5F and back to 1 on ESC[1;5H. less pages on ESC[5~/ESC[6~ but reads ESC[1;5H as its own help key -- it does not decode modifier parameters -- so the bare page keys are universal and the ctrl+ forms depend on the receiving TUI. Claude Code itself honours all four: on a claude 2.1.227 pane with 300 lines of output, ESC[5~ walked the view back 242 -> 212 -> 181 and ESC[1;5F returned to the bottom. Insert and Delete would be one table line each and stay out until a client sends them.
N
Nick007 committed
33b3eee9fcef8178e2203104000025771f1bef6e
Parent: 370c8f9