Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
knz opened this issue Oct 7, 2022 · 2 comments · Fixed by #570
Closed

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

knz opened this issue Oct 7, 2022 · 2 comments · Fixed by #570
Labels
bug Something isn't working

Comments

@knz
Copy link
Contributor

knz commented Oct 7, 2022

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.

@knz
Copy link
Contributor Author

knz commented Oct 7, 2022

This is an extension of #466

@knz
Copy link
Contributor Author

knz commented Oct 7, 2022

I'll try to send a patch for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants