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

fix(input): properly handle bracketed paste #810

Merged
merged 2 commits into from
Oct 27, 2021
Merged

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented Oct 27, 2021

Previously, we handled bracketed paste after parsing the key events from Termion. However, there were some cases in which this would cause Termion to crash (since it itself doesn't handle bracketed paste mode and would get into a wrong state).

This solves this by moving bracketed paste handling to the stdin thread rather than the input thread, detecting it and handling it before parsing the stdin buffer with termion. When in bracketed paste mode, we now send the event directly to the input thread, bypassing termion.

This also has the upside of sending the full pasted text as one message to the server, rather than one message per keystroke, which speeds up pasting considerably.

@imsnif imsnif merged commit 21e5ffd into main Oct 27, 2021
@har7an har7an deleted the fix-bracketed-termion-crash branch October 23, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant