Skip to content

bug: the input reader gobbles up characters after escape sequences #502

@knz

Description

@knz

When a composite input is inserted in the terminal, the terminal can deliver many bytes at once to the process, including escape sequences interleaved with regular keypresses. (This also happens after a process is resumed from sleep and there were input queued while the process was sleeping.)

Currently the input reader only recognizes input boundaries when the read call returns (i.e. no more input to be read).
It is also unable to recognize when an escape sequence is followed by regular bytes (it fails to detect the sequence in the special control character map).

Instead, the input reader should only match a prefix to the current input bytes. Then after the prefix is recognized, it should only discard the prefix, then continue to match on the remainder bytes.

This is partly addressed by #397 but it should really be fixed independently of the bracketed paste feature, as it would benefit any composite input.

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