Skip to content

fix: detect titles and bells in byte writes, skip OSC terminators - #213

Open
jwarykowski wants to merge 1 commit into
coder:mainfrom
jwarykowski:fix/byte-writes-title-bell
Open

jwarykowski wants to merge 1 commit into
coder:mainfrom
jwarykowski:fix/byte-writes-title-bell

Conversation

@jwarykowski

Copy link
Copy Markdown

Two problems in writeInternal when the data comes from a PTY:

  • onTitleChange only fires for string writes. Output written as a Uint8Array (the usual case for a WebSocket with binaryType = 'arraybuffer') never reports its title.
  • onBell fires on any 0x07, 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 checkForTitleChange itself.

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.
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