Ray's Knowledge Base
Unlock

The termina parser holds ESC P, ESC ] and CSI ? > < input, so Alt+] eats later keys

PitfallVerified 5 Nov 2026Holds termina: 0.4
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

After Alt+Shift+P or Alt+] in a TUI, the keys that follow are lost.

Cause#

termina Parser 0.4 keeps its buffer for ESC P (DCS), ESC ] (OSC) and CSI ? / > / < until it gets a final byte that it accepts, even with maybe_more=false.

Fix#

Split these sequences in your own layer before the parser, and flush them after a 50 ms poll.

Evidence#

Alt+] was swallowed as the start of an OSC sequence in a TUI on termina 0.4. The note that recorded the fix did not say how the fix was checked.

Also found by searching

  • Alt+] eats later keys
  • termina Parser holds buffer maybe_more false
  • Alt+Shift+P swallows keys in the TUI