Remove the alt-buffer guard in headless registerMarker so behavior
matches the browser terminal. Update headless public API and typings
to return IMarker instead of IMarker | undefined.
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Avoid per-call allocation when translating many lines in sequence by
resetting a module-level work StringBuilder before and after each use.
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Avoid calling _getCurrentLinkId() twice per codepoint when a hyperlink
is active by reading the link id once before the print loop.
Fixes#5940
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Guard _innerWrite and public write methods after disposal so pending
setTimeout continuations cannot run against a disposed terminal.
Fixes#5936
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace existing.push(...bucket) with an indexed loop in
_mergeLineBucket to avoid intermediate array allocations during
buffer trim/insert/delete re-indexing.
Reuse _mergeLineBucket in _handleBufferLinesTrim for consistency.
Fixes#5941
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Align headless Terminal core API with browser CoreBrowserTerminal
and the public registerMarker naming.
Fixes#5938
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace map().reduce() with one accumulator loop in
reflowSmallerGetNewLineLengths to avoid allocating an intermediate
array when summing wrapped line trimmed lengths.
Fixes#5942
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
The constructor defined property getters/setters twice on _publicOptions;
the first block was immediately overwritten by the second. Align with the
browser public Terminal implementation.
Fixes#5935
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
The windowsPty option change handler checked buildNumber twice
instead of requiring both backend and buildNumber to be defined.
This aligns with Buffer.ts and ensures ConPTY wrapping heuristics
are evaluated only when both fields are present.
Fixes#5934
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace O(n²) string concatenation in the translate loop with
StringBuilder.append, matching the pattern used elsewhere in the project.
Fixes#5939
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace PayloadStringBuffer with LimitedStringBuilder from common.
Add thorough StringBuilder and LimitedStringBuilder test coverage.
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Remove common/Clone.ts and its tests. Use the native structuredClone API
for cloning default modes, options, and test fixtures.
Fixes#5911
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace direct console.log/warn/error calls in the WebGL addon with
ILogService so messages respect the terminal logLevel and custom logger.
Fixesxtermjs/xterm.js#5921
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
configEquals omitted deviceMaxTextureSize, deviceCellWidth, and
deviceCellHeight, which could cause the char atlas cache to reuse an
atlas built for a different GPU texture limit or cell size.
Fixes#5915
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Register vertex array objects for disposal in GlyphRenderer and
RectangleRenderer, matching existing buffer and program cleanup.
Fixes#5918
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Replace repeated string concatenation with a chunk buffer that joins
once on completion. Fixes#5916.
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
flushSync() processes pending writes synchronously (e.g. during
CoreTerminal.resize()) but did not emit onWriteParsed, unlike the
async _innerWrite path. Addons listening for parse completion could
miss updates after resize.
Fixes#5912
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Headless clear() now calls buffer.clearAllMarkers() to match the browser
implementation, preventing markers from surviving clear() and pointing at
wrong lines.
Fixes#5910
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Dispose _onRemoveTextureAtlasCanvas in TextureAtlas.dispose() alongside
_onAddTextureAtlasCanvas to avoid leaking listeners when the atlas is torn down.
Fixes#5917
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>