Repository navigation
fix: keep a dor picker paste and cut-off key sequence across stdin reads - #1954
Merged
Merged
Conversation
The picker parsed each stdin read on its own, so a bracketed paste longer than one read had its later newlines read as Enter, accepting the selected row, and an escape sequence cut at a read's end read as Escape. The parser now lives per picker screen, stays inside a paste until its end marker, and holds an unfinished sequence for the next read; a lone ESC ending a read is still Escape. Closes #1952
Deploying mouseterm with
|
| Latest commit: |
9dd4c9d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e1c108da.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-issue-1952.mouseterm.pages.dev |
dormouse-bot
commented
Nov 30, 2026
dormouse-bot
left a comment
Collaborator
Author
There was a problem hiding this comment.
The held-sequence check isn't anchored at the start, so it can hold back keys that were already complete. I'll push the fix with a test case.
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dor openanddor tool's picker parsed each stdin read with no memory of the previous one, so a bracketed paste longer than one read left its paste mode after the first read: a newline in a later read became Enter and accepted the selected row. In the same way, an escape sequence cut at a read's end became Escape and closed the picker.openPickerScreennow keeps onekeyParser()per screen. The parser stays inside a paste untilESC[201~arrives, holding back a partial end marker, and it keeps an unfinishedESC [ …orESC Ofor the next read. A lone ESC that ends a read is still Escape.parseKeys(chunk)stays as the one-read form.Before the fix,
parseKeyson the readsESC[200~one\n,two\nthree,ESC[201~returnedenterin the second read. The newkeyParsertest indor/test/open-picker.test.mjsfeeds a paste and cut-off sequences across reads, and thedorpicker tests pass.One behavior change: an Alt+
[or Alt+Othat arrives alone in a read is now held until the next read joins it, where before it was dropped right away. A following key can then complete it as a sequence, which is dropped if unknown.Closes #1952 — automated triage