Skip to content

term.write('') throws "offset is out of bounds" #199

Description

@jomymathew

Version: ghostty-web 0.4.0-next.20.g1858a59

What happens
term.write('') throws RangeError: offset is out of bounds (from Uint8Array.set) instead of
being a no-op. A WebSocket consumer that writes every message it receives hits this whenever a
message is empty after its own filtering. In our case, a control sequence is stripped out before
the write.

Repro

const term = new Terminal(); term.open(el);
term.write('');   // RangeError: offset is out of bounds

Expected
No-op, as in xterm.js.

Workaround
Callers skip empty writes (if (data) term.write(data)).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions