SIGN IN SIGN UP

fix: don't print cursor-style sequences as literal text in mirror panes (#21)

CSI sequences carrying an intermediate byte (0x20-0x2F) were rejected by
parse_csi, which accepted only parameter bytes and an alphabetic final. An
unparsed escape falls through to the two-byte ESC skip in apply(), so the
sequence's own tail is written into the grid as printable cells.

DECSCUSR - CSI 2 SP q, "set cursor to steady block" - is emitted by most
TUIs when they pick a cursor shape, and lands in a mirror pane as a literal
"2 q" beside the cursor. It only shows in mirrors because native panes go
through herdr's own parser.

Follow the ECMA-48 grammar instead: parameter bytes 0x30-0x3F, then
intermediates 0x20-0x2F, then a final 0x40-0x7E. Recognizing a sequence is
enough to skip it, since nothing that uses intermediates touches the grid.
The widened final range fixes the same leak for legal non-alphabetic finals
(CSI 3 ~ printed "3~").
M
Markus Warne committed
67a573633be032d07df4ba5ef44b753a7e304291
Parent: 8bfc7cf
Committed by GitHub <noreply@github.com> on 7/31/2026, 3:05:03 AM