Repository navigation
fix: detect titles and bells in byte writes, skip OSC terminators - #213
Open
jwarykowski wants to merge 1 commit into
Open
jwarykowski wants to merge 1 commit into
jwarykowski wants to merge 1 commit into
Conversation
onTitleChange only fired for string writes, so a PTY stream written as Uint8Array never reported its title. onBell fired on any 0x07, including the BEL that ends an OSC sequence, so every title or OSC 8 link rang the bell. Bytes are decoded only when they hold a BEL or ESC ], and OSC sequences are removed before looking for a bell.
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.
Two problems in
writeInternalwhen the data comes from a PTY:onTitleChangeonly fires for string writes. Output written as aUint8Array(the usual case for a WebSocket withbinaryType = 'arraybuffer') never reports its title.onBellfires on any0x07, including the BEL that ends an OSC sequence. Every title change, OSC 8 hyperlink or OSC 52 copy rings the bell.Bytes are now decoded (UTF-8) only when they contain a BEL or
ESC ], so ordinary output stays undecoded. OSC sequences are removed before looking for a bell.Tests cover a bell in bytes, no bell for OSC terminators (string and bytes), and a title written as bytes. The last two fail without the change.
This doesn't overlap #195, which changes
checkForTitleChangeitself.