From 1252c69ccc9580bec036047658ecd03318450cae Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 20:38:51 -0700 Subject: [PATCH 1/9] docs(addons): fix comment typos in unicode-graphemes and web-links Correct grapheme/handling spelling in UnicodeGraphemesAddon header and everything/addresses typos in WebLinksAddon URL matcher comments. Co-authored-by: Cursor --- addons/addon-unicode-graphemes/src/UnicodeGraphemesAddon.ts | 2 +- addons/addon-web-links/src/WebLinksAddon.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/addon-unicode-graphemes/src/UnicodeGraphemesAddon.ts b/addons/addon-unicode-graphemes/src/UnicodeGraphemesAddon.ts index 574a36cc8..09a073571 100644 --- a/addons/addon-unicode-graphemes/src/UnicodeGraphemesAddon.ts +++ b/addons/addon-unicode-graphemes/src/UnicodeGraphemesAddon.ts @@ -2,7 +2,7 @@ * Copyright (c) 2023 The xterm.js authors. All rights reserved. * @license MIT * - * UnicodeVersionProvider for V15 with grapeme cluster handleing. + * UnicodeVersionProvider for V15 with grapheme cluster handling. */ import type { Terminal, ITerminalAddon, IUnicodeHandling } from '@xterm/xterm'; diff --git a/addons/addon-web-links/src/WebLinksAddon.ts b/addons/addon-web-links/src/WebLinksAddon.ts index 3328a3c3f..5e9f6a0ef 100644 --- a/addons/addon-web-links/src/WebLinksAddon.ts +++ b/addons/addon-web-links/src/WebLinksAddon.ts @@ -7,13 +7,13 @@ import type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm'; import type { WebLinksAddon as IWebLinksApi } from '@xterm/addon-web-links'; import { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider'; -// consider everthing starting with http:// or https:// +// consider everything starting with http:// or https:// // up to first whitespace, `"` or `'` as url // NOTE: The repeated end clause is needed to not match a dangling `:` // resembling the old (...)*([^:"\'\\s]) final path clause // additionally exclude early + final: // - unsafe from rfc3986: !*'() -// - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 adresses, also allow ~) +// - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 addresses, also allow ~) // also exclude as finals: // - final interpunction like ,.!? // - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls) From a47e4905e6d2f7f8098f23da01a763e1c8500a7a Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 20:53:52 -0700 Subject: [PATCH 2/9] docs(addon-webgl): fix comment typos in TextureAtlas and GlyphRenderer Correct "transferred", remove duplicate "is", and use "one-off" instead of "once of" in developer-facing comments. Co-authored-by: Cursor --- addons/addon-webgl/src/GlyphRenderer.ts | 2 +- addons/addon-webgl/src/TextureAtlas.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/addon-webgl/src/GlyphRenderer.ts b/addons/addon-webgl/src/GlyphRenderer.ts index 650fc451a..4117525c4 100644 --- a/addons/addon-webgl/src/GlyphRenderer.ts +++ b/addons/addon-webgl/src/GlyphRenderer.ts @@ -220,7 +220,7 @@ export class GlyphRenderer extends Disposable { public updateCell(x: number, y: number, code: number, bg: number, fg: number, ext: number, chars: string, width: number, lastBg: number): void { // Since this function is called for every cell (`rows*cols`), it must be very optimized. It // should not instantiate any variables unless a new glyph is drawn to the cache where the - // slight slowdown is acceptable for the developer ergonomics provided as it's a once of for + // slight slowdown is acceptable for the developer ergonomics provided as it's a one-off for // each glyph. this._updateCell(this._vertices.attributes, x, y, code, bg, fg, ext, chars, width, lastBg); } diff --git a/addons/addon-webgl/src/TextureAtlas.ts b/addons/addon-webgl/src/TextureAtlas.ts index dab0b1c85..31db49a7f 100644 --- a/addons/addon-webgl/src/TextureAtlas.ts +++ b/addons/addon-webgl/src/TextureAtlas.ts @@ -69,7 +69,7 @@ export class TextureAtlas implements ITextureAtlas { private _overflowSizePage: AtlasPage | undefined; private _tmpCanvas: HTMLCanvasElement; - // A temporary context that glyphs are drawn to before being transfered to the atlas. + // A temporary context that glyphs are drawn to before being transferred to the atlas. private _tmpCtx: CanvasRenderingContext2D; private _workBoundingBox: IBoundingBox = { top: 0, left: 0, bottom: 0, right: 0 }; @@ -152,7 +152,7 @@ export class TextureAtlas implements ITextureAtlas { } private _createNewPage(): AtlasPage { - // Try merge the set of the 4 most used pages of the largest size. This is is deferred to a + // Try merge the set of the 4 most used pages of the largest size. This is deferred to a // microtask to ensure it does not interrupt textures that will be rendered in the current // animation frame which would result in blank rendered areas. This is actually not that // expensive relative to drawing the glyphs, so there is no need to wait for an idle callback. From 58fc09ff0e33017b87525b4d599767a0ef8e2594 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 22:05:21 -0700 Subject: [PATCH 3/9] docs(webgl): remove duplicate word in context lost README The webglcontextlost section repeated "fired" ("fires the ... event fired on the canvas"). Drop the extra word. Co-authored-by: Cursor --- addons/addon-webgl/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/addon-webgl/README.md b/addons/addon-webgl/README.md index 9d89863f3..47a03b72e 100644 --- a/addons/addon-webgl/README.md +++ b/addons/addon-webgl/README.md @@ -23,7 +23,7 @@ See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/addon- ### Handling Context Loss -The browser may drop WebGL contexts for various reasons like OOM or after the system has been suspended. There is an API exposed that fires the `webglcontextlost` event fired on the canvas so embedders can handle it however they wish. An easy, but suboptimal way, to handle this is by disposing of WebglAddon when the event fires: +The browser may drop WebGL contexts for various reasons like OOM or after the system has been suspended. There is an API exposed that fires the `webglcontextlost` event on the canvas so embedders can handle it however they wish. An easy, but suboptimal way, to handle this is by disposing of WebglAddon when the event fires: ```ts const terminal = new Terminal(); From 3494f6b5b0c31bcaf2bf52927749efe714d84952 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:29:02 +0000 Subject: [PATCH 4/9] docs: fix additional comment typos across renderer and selection (addons only) Co-authored-by: Daniel Imms --- addons/addon-webgl/src/WebglRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/addon-webgl/src/WebglRenderer.ts b/addons/addon-webgl/src/WebglRenderer.ts index 264bfda6e..d26c6d25e 100644 --- a/addons/addon-webgl/src/WebglRenderer.ts +++ b/addons/addon-webgl/src/WebglRenderer.ts @@ -667,7 +667,7 @@ export class WebglRenderer extends Disposable implements IRenderer { // The the size of the canvas on the page. It's important that this rounds to nearest integer // and not ceils as browsers often have floating point precision issues where // `window.devicePixelRatio` ends up being something like `1.100000023841858` for example, when - // it's actually 1.1. Ceiling may causes blurriness as the backing canvas image is 1 pixel too + // it's actually 1.1. Ceiling may cause blurriness as the backing canvas image is 1 pixel too // large for the canvas element size. this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / this._devicePixelRatio); this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / this._devicePixelRatio); From fa5eb33cdb141762042410cb80bacd8087cbea45 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:29:02 +0000 Subject: [PATCH 5/9] fix: small comment, error string, and guard cleanups (addons only) Co-authored-by: Daniel Imms --- addons/addon-serialize/src/SerializeAddon.ts | 2 +- addons/addon-webgl/src/TextureAtlas.ts | 2 +- addons/addon-webgl/src/WebglAddon.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/addon-serialize/src/SerializeAddon.ts b/addons/addon-serialize/src/SerializeAddon.ts index 0aad8e1d6..26ede1c41 100644 --- a/addons/addon-serialize/src/SerializeAddon.ts +++ b/addons/addon-serialize/src/SerializeAddon.ts @@ -173,7 +173,7 @@ class StringSerializeHandler extends BaseSerializeHandler { private _thisRowLastSecondChar: IBufferCell = this._buffer.getNullCell(); private _nextRowFirstChar: IBufferCell = this._buffer.getNullCell(); protected _rowEnd(row: number, isLastRow: boolean): void { - // if there is colorful empty cell at line end, whe must pad it back, or the the color block + // if there is colorful empty cell at line end, we must pad it back, or the color block // will missing if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) { // use clear right to set background. diff --git a/addons/addon-webgl/src/TextureAtlas.ts b/addons/addon-webgl/src/TextureAtlas.ts index 31db49a7f..53d2d056f 100644 --- a/addons/addon-webgl/src/TextureAtlas.ts +++ b/addons/addon-webgl/src/TextureAtlas.ts @@ -1125,7 +1125,7 @@ function clearColor(imageData: ImageData, bg: IColor, fg: IColor, enableThreshol // were covered (fg=#8ae234, bg=#c4a000). const threshold = Math.floor((Math.abs(r - fgR) + Math.abs(g - fgG) + Math.abs(b - fgB)) / 12); - // Set alpha channel of relevent pixels to 0 + // Set alpha channel of relevant pixels to 0 let isEmpty = true; for (let offset = 0; offset < imageData.data.length; offset += 4) { // Check exact match diff --git a/addons/addon-webgl/src/WebglAddon.ts b/addons/addon-webgl/src/WebglAddon.ts index 624c9ea38..f61206b13 100644 --- a/addons/addon-webgl/src/WebglAddon.ts +++ b/addons/addon-webgl/src/WebglAddon.ts @@ -40,7 +40,7 @@ export class WebglAddon extends Disposable implements ITerminalAddon, IWebglApi }; const gl = document.createElement('canvas').getContext('webgl2', contextAttributes) as IWebGL2RenderingContext; if (!gl) { - throw new Error('Webgl2 is only supported on Safari 16 and above'); + throw new Error('WebGL2 is only supported on Safari 16 and above'); } } super(); From 1faa41eac1585260786e87cb0db2ca2aea88d620 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:29:03 +0000 Subject: [PATCH 6/9] docs: fix typos in typings, tests, and core comments (addons only) Co-authored-by: Daniel Imms --- addons/addon-clipboard/typings/addon-clipboard.d.ts | 2 +- addons/addon-webgl/typings/addon-webgl.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/addon-clipboard/typings/addon-clipboard.d.ts b/addons/addon-clipboard/typings/addon-clipboard.d.ts index f8e024ac3..f5a892e21 100644 --- a/addons/addon-clipboard/typings/addon-clipboard.d.ts +++ b/addons/addon-clipboard/typings/addon-clipboard.d.ts @@ -82,7 +82,7 @@ declare module '@xterm/addon-clipboard' { /** * The clipboard provider interface that enables xterm.js to access the browser clipboard. * - * Note this this clipboard provider does not implement own cut buffers as xterm does, + * Note that this clipboard provider does not implement own cut buffers as xterm does, * but redirect the selection parameter always to navigator.clipboard. */ export class BrowserClipboardProvider implements IClipboardProvider{ diff --git a/addons/addon-webgl/typings/addon-webgl.d.ts b/addons/addon-webgl/typings/addon-webgl.d.ts index 37b6b8a95..37acbb8a9 100644 --- a/addons/addon-webgl/typings/addon-webgl.d.ts +++ b/addons/addon-webgl/typings/addon-webgl.d.ts @@ -23,12 +23,12 @@ declare module '@xterm/addon-webgl' { public readonly onChangeTextureAtlas: IEvent; /** - * An event that is fired when the a new page is added to the texture atlas. + * An event that is fired when a new page is added to the texture atlas. */ public readonly onAddTextureAtlasCanvas: IEvent; /** - * An event that is fired when the a page is removed from the texture atlas. + * An event that is fired when a page is removed from the texture atlas. */ public readonly onRemoveTextureAtlasCanvas: IEvent; From 0b590dacd64d489669eb2b73edd44d40ab72c6ce Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:29:04 +0000 Subject: [PATCH 7/9] docs: fix comment typos in BufferReflow, Types, and addons (addons only) Co-authored-by: Daniel Imms --- addons/addon-serialize/test/SerializeAddon.test.ts | 2 +- addons/addon-webgl/src/WebglRenderer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/addon-serialize/test/SerializeAddon.test.ts b/addons/addon-serialize/test/SerializeAddon.test.ts index fb42d807d..c8dba3039 100644 --- a/addons/addon-serialize/test/SerializeAddon.test.ts +++ b/addons/addon-serialize/test/SerializeAddon.test.ts @@ -192,7 +192,7 @@ test.describe('SerializeAddon', () => { const cols = 10; const line = '+'.repeat(cols); const lines: string[] = [ - sgr(FG_P16_GREEN) + line, // Workaround: If we clear all flags a the end, serialize will use \x1b[0m to clear instead of the sepcific disable sequence + sgr(FG_P16_GREEN) + line, // Workaround: If we clear all flags at the end, serialize will use \x1b[0m to clear instead of the specific disable sequence sgr(INVERSE) + line, sgr(BOLD) + line, sgr(UNDERLINED) + line, diff --git a/addons/addon-webgl/src/WebglRenderer.ts b/addons/addon-webgl/src/WebglRenderer.ts index d26c6d25e..2f38e03cb 100644 --- a/addons/addon-webgl/src/WebglRenderer.ts +++ b/addons/addon-webgl/src/WebglRenderer.ts @@ -664,7 +664,7 @@ export class WebglRenderer extends Disposable implements IRenderer { this.dimensions.device.canvas.height = this._terminal.rows * this.dimensions.device.cell.height; this.dimensions.device.canvas.width = this._terminal.cols * this.dimensions.device.cell.width; - // The the size of the canvas on the page. It's important that this rounds to nearest integer + // The size of the canvas on the page. It's important that this rounds to nearest integer // and not ceils as browsers often have floating point precision issues where // `window.devicePixelRatio` ends up being something like `1.100000023841858` for example, when // it's actually 1.1. Ceiling may cause blurriness as the backing canvas image is 1 pixel too From be38252e37ecfa1f86f82e8a02543d8ea2d9bed4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:29:04 +0000 Subject: [PATCH 8/9] docs: fix comment typos in Constants, DomRenderer, and addons (addons only) Co-authored-by: Daniel Imms --- addons/addon-ligatures/src/index.ts | 2 +- addons/addon-serialize/src/SerializeAddon.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/addon-ligatures/src/index.ts b/addons/addon-ligatures/src/index.ts index fb8e85e73..2fc664f5b 100644 --- a/addons/addon-ligatures/src/index.ts +++ b/addons/addon-ligatures/src/index.ts @@ -21,7 +21,7 @@ const CACHE_SIZE = 100000; /** * Enable ligature support for the provided Terminal instance. To function - * properly, this must be called after `open()` is called on the therminal. If + * properly, this must be called after `open()` is called on the terminal. If * the font currently in use supports ligatures, the terminal will automatically * start to render them. * @param term Terminal instance from xterm.js diff --git a/addons/addon-serialize/src/SerializeAddon.ts b/addons/addon-serialize/src/SerializeAddon.ts index 26ede1c41..e1728feb2 100644 --- a/addons/addon-serialize/src/SerializeAddon.ts +++ b/addons/addon-serialize/src/SerializeAddon.ts @@ -221,7 +221,7 @@ class StringSerializeHandler extends BaseSerializeHandler { // you can't use control sequence to move cursor to (x === row) (thisRowLastChar.getChars() || thisRowLastChar.getWidth() === 0) && // change background of the first wrapped cell also affects BCE - // so we mark it as invalid to simply the process to determine line separator + // so we mark it as invalid to simplify the process to determine line separator equalBg(thisRowLastChar, nextRowFirstChar) ) { isValid = true; @@ -233,7 +233,7 @@ class StringSerializeHandler extends BaseSerializeHandler { isNextRowFirstCharDoubleWidth && (thisRowLastSecondChar.getChars() || thisRowLastSecondChar.getWidth() === 0) && // change background of the first wrapped cell also affects BCE - // so we mark it as invalid to simply the process to determine line separator + // so we mark it as invalid to simplify the process to determine line separator equalBg(thisRowLastChar, nextRowFirstChar) && equalBg(thisRowLastSecondChar, nextRowFirstChar) ) { From 6426573f455eba613655a641e5e90da4b3dc48e6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 1 Jun 2026 15:30:04 +0000 Subject: [PATCH 9/9] docs(addon-web-links): shorten comment to satisfy max-len after typo fix Co-authored-by: Daniel Imms --- addons/addon-web-links/src/WebLinksAddon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/addon-web-links/src/WebLinksAddon.ts b/addons/addon-web-links/src/WebLinksAddon.ts index 5e9f6a0ef..6ea1bc8d9 100644 --- a/addons/addon-web-links/src/WebLinksAddon.ts +++ b/addons/addon-web-links/src/WebLinksAddon.ts @@ -13,7 +13,7 @@ import { ILinkProviderOptions, WebLinkProvider } from './WebLinkProvider'; // resembling the old (...)*([^:"\'\\s]) final path clause // additionally exclude early + final: // - unsafe from rfc3986: !*'() -// - unsafe chars from rfc1738: {}|\^~[]` (minus [] as we need them for ipv6 addresses, also allow ~) +// - unsafe chars from rfc1738: {}|\^~[]` (minus [] for ipv6 addresses, also allow ~) // also exclude as finals: // - final interpunction like ,.!? // - any sort of brackets <>()[]{} (not spec conform, but often used to enclose urls)