Skip to content

Add attributesEqual and underline diff APIs#5682

Merged
Tyriar merged 3 commits intoxtermjs:masterfrom
Tyriar:3440
Feb 7, 2026
Merged

Add attributesEqual and underline diff APIs#5682
Tyriar merged 3 commits intoxtermjs:masterfrom
Tyriar:3440

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Feb 7, 2026

Fixes #3440

@Tyriar Tyriar added this to the 7.0.0 milestone Feb 7, 2026
@Tyriar Tyriar self-assigned this Feb 7, 2026
@Tyriar Tyriar requested a review from Copilot February 7, 2026 14:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes additional buffer cell attribute APIs (underline style/color + attribute diffing) to make it easier for consumers/addons to compare cell styling without reimplementing internal logic.

Changes:

  • Add IBufferCell underline getters and new attributesEquals method to the public typings (browser + headless).
  • Implement attributesEquals on CellData and add unit/integration coverage for underline-style/color comparisons.
  • Update SerializeAddon to use the new public underline APIs and optimize style diffing.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
typings/xterm.d.ts Adds new IBufferCell underline getters + attributesEquals to the public browser typings.
typings/xterm-headless.d.ts Mirrors the new IBufferCell underline getters + attributesEquals in headless typings.
src/common/public/BufferLineApiView.ts Adjusts casting around loadCell to account for updated public IBufferCell shape.
src/common/buffer/CellData.ts Implements attributesEquals on the internal CellData used to back public buffer cells.
src/common/buffer/CellData.test.ts New unit tests validating attributesEquals, including underline-related exclusions.
src/browser/services/SelectionService.ts Broadens _isCharWordSeparator to accept ICellData (typing alignment).
src/browser/renderer/dom/DomRendererRowFactory.ts Tightens a local variable type to ICellData (typing alignment).
addons/addon-serialize/test/SerializeAddon.test.ts Adds Playwright coverage for attributesEquals behavior on real buffer cells.
addons/addon-serialize/src/SerializeAddon.ts Uses new underline getters and leverages attributesEquals when available to shortcut diffs.
addons/addon-serialize/src/SerializeAddon.test.ts Updates expectation for single-underline serialization to emit SGR 4 instead of SGR 4:1.

@Tyriar Tyriar marked this pull request as ready for review February 7, 2026 14:29
@Tyriar Tyriar enabled auto-merge February 7, 2026 14:29
@Tyriar Tyriar merged commit e14746e into xtermjs:master Feb 7, 2026
12 checks passed
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.

Provide an API to diff cell attributes

1 participant