Skip to content

Unknown CSI inputs result in garbage key events #466

@knz

Description

@knz

When a terminal CSI sequence is not recognized by bubbletea, it is not completely ignored; instead, bubbletea will match the initial escape byte and the character immediately afterwards as a single key with the alt modifier, then interpret the rest as regular key inputs. For example, ESC [ 1003 h gets parsed as alt+1, then 0, then 0, then 3, then h.

Since the CSI sequences all have a regular structure, they could be parsed and ignored as a single unit.

(The definition is strict: a CSI sequence starts with ESC [ and terminates with a byte value in the range 0x40 to 0x7E.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions