Compare commits

...
Author SHA1 Message Date
Daniel Imms 041d3bc3db Merge branch 'master' into cursor/cross-cutting-doc-comments-cf99 2026-06-01 08:35:08 -07:00
Daniel Imms 560c0ce3a1 Merge pull request #5978 from xtermjs/cursor/src-docs-typos-0755
docs(src): fix comment and JSDoc typos
2026-06-01 08:33:32 -07:00
Daniel Imms 94958c2489 Fix whitespace 2026-06-01 08:33:02 -07:00
Daniel Imms ea2a506142 Merge branch 'master' into cursor/cross-cutting-doc-comments-cf99 2026-06-01 08:31:31 -07:00
Daniel Imms 5ab59506aa Merge pull request #5975 from xtermjs/cursor/contributing-typo-b5c5
docs: fix typo in CONTRIBUTING.md
2026-06-01 08:30:00 -07:00
Daniel ImmsandCursor be3dd80171 docs(parser): fix JSDoc typos in IFunctionIdentifier
Correct "representation" and "registration" spelling in the comment
describing how handler identifiers are encoded for EscapeSequenceParser.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor 2db34c4955 docs(common): fix main thread spelling in TaskQueue comment
Change "mainthread" to "main thread" in the workload scheduling note.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor 8854430df4 docs(parser): fix sub-parameter limit name in Params JSDoc
addSubParam documents a cap on stored sub parameters; the limit is
enforced via maxSubParamsLength, not subParamsLength (the current count).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor 26e771d075 docs(common): fix grammar in Unicode and platform comments
Use "a Unicode" instead of "an Unicode" on IUnicodeService.register,
and "user's platform" instead of "users platform" above the platform
detection exports.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor fd13893687 docs(buffer): fix possessive typo in Windows conpty comment
Change "it's view" to "its view" in the comment explaining why new
rows are appended on Windows when using conpty.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor 5ef8001413 docs(common): fix activeVersion onChange JSDoc wording
The onChange event comment said "activate version changed" while the
property is activeVersion. Clarify that the event fires when the active
Unicode version changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor e2d1420ff7 docs(common): fix throughput typo in WriteBuffer comment
Correct "throughtput" to "throughput" in the FPS vs throughput tradeoff
note inside WriteBuffer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor cf1484d7fd docs(browser): fix incomplete and typo comments in Mouse.ts
getCoords had a truncated comment ("if there are no valid") and a typo
("addition" vs "additional") in the selection precision note. Complete
the char-size guard comment and fix the selection wording.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:36 +00:00
Daniel ImmsandCursor e12f007597 docs(buffer): fix Content enum names in Constants JSDoc
The Content bitmask JSDoc examples used camelCase names that do not
exist on the enum (codepointMask, isCombined, hasContent, widthMask,
widthShift). Update examples to match the real members:
CODEPOINT_MASK, IS_COMBINED_MASK, HAS_CONTENT_MASK, WIDTH_MASK, and
WIDTH_SHIFT as used throughout BufferLine and CellData.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:35 +00:00
Daniel ImmsandCursor 5527814e08 docs: fix suppress and addressable spelling in mouse comments
Correct "supress"/"addressible" to "suppress"/"addressable" in
MouseStateService, MouseService tests, and InputHandler test titles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:34 +00:00
Daniel ImmsandCursor d47ea40010 docs: fix comment typos in Constants, DomRenderer, and addons
- Constants: "indicating" in combined-content flag JSDoc
- DomRenderer: viewportStartRow spelling in comment
- SerializeAddon: "simplify" instead of "simply"
- addon-ligatures: "terminal" instead of "therminal"

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:34 +00:00
Daniel ImmsandCursor c78f77cc17 docs: fix comment typos in BufferReflow, Types, and addons
- BufferReflow: name reflowLarger correctly; "Creates and returns"
- Types: "suppress" spelling in CoreMouseEncoding JSDoc
- SerializeAddon.test: "at the end" and "specific" in workaround comment
- WebglRenderer: remove duplicate "The" in canvas size comment

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:34 +00:00
Daniel ImmsandCursor ebe7af5bf4 docs: fix typos in typings, tests, and core comments
- addon-clipboard: "Note that this" instead of duplicate "this"
- addon-webgl: remove stray "the" before "a" in event JSDoc
- SharedRendererTests: duplicate "the" in test title
- Types: "protocol" spelling in CoreMouseEncoding JSDoc
- InputHandler: "a replacement char" article fix

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:33 +00:00
Daniel ImmsandCursor faaa549355 fix: small comment, error string, and guard cleanups
- Services JSDoc: "to determine" grapheme clustering wording
- AttributeData: "persistent" spelling in comment
- Buffer.setupTabStops: check only `undefined` (param is `number | undefined`)
- SerializeAddon: fix "we must" and duplicate "the" in comment
- WebglAddon: use "WebGL2" in Safari support error for consistency
- TextureAtlas: "relevant" spelling in comment

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:33 +00:00
Daniel ImmsandCursor 1e554992f6 docs: fix additional comment typos across renderer and selection
Correct scrambled FIXME wording in InputHandler, "however" in
DomRenderer, duplicate "the" in selection code, "separate" and grammar
in DomRendererRowFactory, and "may cause" in WebglRenderer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:33 +00:00
Daniel ImmsandCursor 3a4f9e235d docs: fix "transferred" spelling in CONTRIBUTING.md
Correct typo in the note about moving support questions to
GitHub discussions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:28 +00:00
Daniel ImmsandCursor 7b05c8a1b2 docs: fix comment and JSDoc spelling typos
Correct "occurred" in IMouseEvent and keydown JSDoc, remove duplicate
"This" in EscapeSequenceParser ZDM comment, use "elapsed" instead of
"lapsed" in TimeBasedDebouncer, and fix "event" in Keyboard comment.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:14 +00:00
Daniel ImmsandCursor b45167e00b docs: fix comment typos in ThemeService and Constants
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:14 +00:00
Daniel ImmsandCursor bc42be2074 docs(common): correct ST sequence metadata and comment typos
- EscapeSequenceParser: ESC ST is ESC backslash (0x1B 0x5C), not ESC
  plus a double-quote character; align @vt metadata with C1 ST on the
  following line.
- Color.contrastRatio: document l2 as the second luminance argument.
- Marker.dispose: fix "change" -> "chance" in dispose listener comment.
- Buffer.clear: fix possessive "it's" -> "its" in JSDoc.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 15:28:14 +00:00
37 changed files with 66 additions and 66 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ The preferred way to report bugs or request features is to use
It's pretty common for maintainers of large open source projects to suffer from burnout, especially when needing to triage a large number of incoming issues instead of actually building things. Here are some of the steps we take to try mitigate this:
- Support questions live in [GH discussions](https://github.com/xtermjs/xterm.js/discussions), issues may be transfered there without further comment and core maintainers may or may not participate in discussions.
- Support questions live in [GH discussions](https://github.com/xtermjs/xterm.js/discussions), issues may be transferred there without further comment and core maintainers may or may not participate in discussions.
- Issues are strictly for well defined features or bugs that are _actionable_.
- Sometimes features are out of scope. A common example of this is a niche feature that the pricipal implementation ([VS Code](https://code.visualstudio.com/)) won't leverage and therefore would be difficult to maintain and likely suffer from bitrot. The reporter may not agree with this, but you could always create an addon if that works or maintain your own fork if it comes to that.
- If a feature does not have a clear way forward or needs more discussion it may be closed ro moved to a discussion.
+1 -1
View File
@@ -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{
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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.
@@ -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)
) {
@@ -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,
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -664,10 +664,10 @@ 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 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);
+2 -2
View File
@@ -23,12 +23,12 @@ declare module '@xterm/addon-webgl' {
public readonly onChangeTextureAtlas: IEvent<HTMLCanvasElement>;
/**
* 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<HTMLCanvasElement>;
/**
* 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<HTMLCanvasElement>;
+1 -1
View File
@@ -102,7 +102,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
private _keyDownHandled: boolean = false;
/**
* Records whether a keydown event has occured since the last keyup event, i.e. whether a key
* Records whether a keydown event has occurred since the last keyup event, i.e. whether a key
* is currently "pressed".
*/
private _keyDownSeen: boolean = false;
+1 -1
View File
@@ -47,7 +47,7 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
// enough time to pass before refreshing again.
const refreshRequestTime: number = performance.now();
if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {
// Enough time has lapsed since the last refresh; refresh immediately
// Enough time has elapsed since the last refresh; refresh immediately
this._lastRefreshMs = refreshRequestTime;
this._innerRefresh();
} else if (!this._additionalRefreshRequested) {
+2 -2
View File
@@ -31,7 +31,7 @@ export function getCoordsRelativeToElement(window: Pick<Window, 'getComputedStyl
* select that cell and the right half will select the next cell.
*/
export function getCoords(window: Pick<Window, 'getComputedStyle'>, event: Pick<MouseEvent, 'clientX' | 'clientY'>, element: HTMLElement, colCount: number, rowCount: number, hasValidCharSize: boolean, cssCellWidth: number, cssCellHeight: number, isSelection?: boolean): [number, number] | undefined {
// Coordinates cannot be measured if there are no valid
// Coordinates cannot be measured if there is no valid character size.
if (!hasValidCharSize) {
return undefined;
}
@@ -45,7 +45,7 @@ export function getCoords(window: Pick<Window, 'getComputedStyle'>, event: Pick<
coords[1] = Math.ceil(coords[1] / cssCellHeight);
// Ensure coordinates are within the terminal viewport. Note that selections
// need an addition point of precision to cover the end point (as characters
// need an additional point of precision to cover the end point (as characters
// cover half of one char and half of the next).
coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));
coords[1] = Math.min(Math.max(coords[1], 1), rowCount);
+2 -2
View File
@@ -33,7 +33,7 @@ let nextTerminalId = 1;
/**
* The standard renderer and fallback for when the webgl addon is slow. This is not meant to be
* particularly fast and will even lack some features such as custom glyphs, hoever this is more
* particularly fast and will even lack some features such as custom glyphs, however this is more
* reliable as webgl may not work on some machines.
*/
export class DomRenderer extends Disposable implements IRenderer {
@@ -430,7 +430,7 @@ export class DomRenderer extends Disposable implements IRenderer {
documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow + 1, 0, this._bufferService.cols, middleRowsCount));
// Draw final row
if (viewportCappedStartRow !== viewportCappedEndRow) {
// Only draw viewportEndRow if it's not the same as viewporttartRow
// Only draw viewportEndRow if it's not the same as viewportStartRow
const finalEndCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;
documentFragment.appendChild(this._createSelectionElement(viewportCappedEndRow, 0, finalEndCol));
}
@@ -380,7 +380,7 @@ export class DomRendererRowFactory {
if (!isTop && isInSelection) {
// If in the selection, force the element to be above the selection to improve contrast and
// support opaque selections. The applies background is not actually needed here as
// selection is drawn in a seperate container, the main purpose of this to ensuring minimum
// selection is drawn in a separate container; the main purpose of this is to ensure minimum
// contrast ratio
bgOverride = this._coreBrowserService.isFocused ? colors.selectionBackgroundOpaque : colors.selectionInactiveBackgroundOpaque;
bg = bgOverride.rgba >> 8 & 0xFFFFFF;
+1 -1
View File
@@ -88,7 +88,7 @@ export class SelectionModel {
return [startPlusLength, this.selectionStart[1]];
}
// Ensure the the word/line is selected after a double/triple click
// Ensure the word/line is selected after a double/triple click
if (this.selectionStartLength) {
// Select the larger of the two when start and end are on the same line
if (this.selectionEnd[1] === this.selectionStart[1]) {
+1 -1
View File
@@ -176,7 +176,7 @@ describe('MouseService _triggerMouseEvent', () => {
for (let i = 0; i < bufferService.cols; ++i) {
assert.equal(trigger({ col: i, row: 0, x: 0, y: 0, button: CoreMouseButton.LEFT, action: CoreMouseAction.DOWN }), true);
if (i > 222) {
// supress mouse reports if we are out of addressible range (max. 222)
// suppress mouse reports if we are out of addressable range (max. 222)
assert.deepEqual(toBytes(reports.pop()), []);
} else {
assert.deepEqual(toBytes(reports.pop()), [0x1b, 0x5b, 0x4d, 0x20, i + 33, 0x21]);
+2 -2
View File
@@ -927,7 +927,7 @@ export class SelectionService extends Disposable implements ISelectionService {
// Incremenet the end index so it is at the start of the next character
endIndex++;
// Calculate the start _column_, converting the the string indexes back to
// Calculate the start _column_, converting the string indexes back to
// column coordinates.
let start =
startIndex // The index of the selection's start char in the line string
@@ -935,7 +935,7 @@ export class SelectionService extends Disposable implements ISelectionService {
- leftWideCharCount // The number of wide chars left of the initial char
+ leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)
// Calculate the length in _columns_, converting the the string indexes back
// Calculate the length in _columns_, converting the string indexes back
// to column coordinates.
let length = Math.min(this._bufferService.cols, // Disallow lengths larger than the terminal cols
endIndex // The index of the selection's end char in the line string
+1 -1
View File
@@ -132,7 +132,7 @@ export class ThemeService extends Disposable implements IThemeService {
colors.ansi[i + 16] = parseColor(theme.extendedAnsi[i], DEFAULT_ANSI_COLORS[i + 16]);
}
}
// Clear our the cache
// Clear the cache
this._contrastCache.clear();
this._halfContrastCache.clear();
this._updateRestoreColors();
+1 -1
View File
@@ -373,7 +373,7 @@ export function toPaddedHex(c: number): string {
/**
* Gets the contrast ratio between two relative luminance values.
* @param l1 The first relative luminance.
* @param l2 The first relative luminance.
* @param l2 The second relative luminance.
* @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
*/
export function contrastRatio(l1: number, l2: number): number {
+1 -1
View File
@@ -1241,7 +1241,7 @@ describe('InputHandler', () => {
await inputHandler.parseP('\x1b[e');
assert.deepEqual(getCursor(bufferService), [8, 5]);
});
describe('should clamp cursor into addressible range', () => {
describe('should clamp cursor into addressable range', () => {
it('CUF', async () => {
bufferService.buffer.x = 10000;
bufferService.buffer.y = 10000;
+2 -2
View File
@@ -273,7 +273,7 @@ export class InputHandler extends Disposable implements IInputHandler {
this._parser.setExecuteHandler(C0.HT, () => this.tab());
this._parser.setExecuteHandler(C0.SO, () => this.shiftOut());
this._parser.setExecuteHandler(C0.SI, () => this.shiftIn());
// FIXME: What do to with missing? Old code just added those to print.
// FIXME: What to do with missing? Old code just added those to print.
this._parser.setExecuteHandler(C1.IND, () => this.index());
this._parser.setExecuteHandler(C1.NEL, () => this.nextLine());
@@ -550,7 +550,7 @@ export class InputHandler extends Disposable implements IInputHandler {
// get charset replacement character
// charset is only defined for ASCII, therefore we only
// search for an replacement char if code < 127
// search for a replacement char if code < 127
if (code < 127 && charset) {
const ch = charset[String.fromCharCode(code)];
if (ch) {
+1 -1
View File
@@ -44,7 +44,7 @@ export function getSafariVersion(): number {
return parseInt(majorVersion[1], 10);
}
// Find the users platform. We use this to interpret the meta key
// Find the user's platform. We use this to interpret the meta key
// and ISO third level shifts.
// http://stackoverflow.com/q/19877924/577598
export const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);
+1 -1
View File
@@ -8,7 +8,7 @@ import type { ILogService } from './services/Services';
interface ITaskQueue {
/**
* Adds a task to the queue which will run in a future idle callback.
* To avoid perceivable stalls on the mainthread, tasks with heavy workload
* To avoid perceivable stalls on the main thread, tasks with heavy workload
* should split their work into smaller pieces and return `true` to get
* called again until the work is done (on falsy return value).
*/
+3 -3
View File
@@ -181,7 +181,7 @@ export interface ICoreMouseEvent {
x: number;
y: number;
/**
* Button the action occured. Due to restrictions of the tracking protocols
* Button the action occurred. Due to restrictions of the tracking protocols
* it is not possible to report multiple buttons at once.
* Wheel is treated as a button.
* There are invalid combinations of buttons and actions possible
@@ -234,9 +234,9 @@ export interface ICoreMouseProtocol {
/**
* CoreMouseEncoding
* The tracking encoding can be registered and activated at the MouseStateService.
* If a ICoreMouseEvent passes all procotol restrictions it will be encoded
* If a ICoreMouseEvent passes all protocol restrictions it will be encoded
* with the active encoding and sent out.
* Note: Returning an empty string will supress sending a mouse report,
* Note: Returning an empty string will suppress sending a mouse report,
* which can be used to skip creating falsey reports in limited encodings
* (DEFAULT only supports up to 223 1-based as coord value).
*/
+1 -1
View File
@@ -204,7 +204,7 @@ export class ExtendedAttrs implements IExtendedAttrs {
/**
* Convenient method to indicate whether the object holds no additional information,
* that needs to be persistant in the buffer.
* that needs to be persistent in the buffer.
*/
public isEmpty(): boolean {
return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;
+3 -3
View File
@@ -142,7 +142,7 @@ export class Buffer extends Disposable implements IBuffer {
}
/**
* Clears the buffer to it's initial state, discarding all previous data.
* Clears the buffer to its initial state, discarding all previous data.
*/
public clear(): void {
this._stringCache.clear();
@@ -197,7 +197,7 @@ export class Buffer extends Disposable implements IBuffer {
for (let y = this._rows; y < newRows; y++) {
if (this.lines.length < newRows + this.ybase) {
if (this._optionsService.rawOptions.windowsPty.backend !== undefined || this._optionsService.rawOptions.windowsPty.buildNumber !== undefined) {
// Just add the new missing rows on Windows as conpty reprints the screen with it's
// Just add the new missing rows on Windows as conpty reprints the screen with its
// view of the world. Once a line enters scrollback for conpty it remains there
this.lines.push(new BufferLine(this._stringCache, newCols, nullCell, false));
} else {
@@ -578,7 +578,7 @@ export class Buffer extends Disposable implements IBuffer {
* @param i The index to start setting up tab stops from.
*/
public setupTabStops(i?: number): void {
if (i !== null && i !== undefined) {
if (i !== undefined) {
if (!this.tabs[i]) {
i = this.prevStop(i);
}
+2 -2
View File
@@ -13,7 +13,7 @@ export interface INewLayoutResult {
}
/**
* Evaluates and returns indexes to be removed after a reflow larger occurs. Lines will be removed
* Evaluates and returns indexes to be removed after reflowLarger occurs. Lines will be removed
* when a wrapped line unwraps.
* @param lines The buffer lines.
* @param oldCols The columns before resize
@@ -109,7 +109,7 @@ export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, o
}
/**
* Creates and return the new layout for lines given an array of indexes to be removed.
* Creates and returns the new layout for lines given an array of indexes to be removed.
* @param lines The buffer lines.
* @param toRemove The indexes to remove.
*/
+13 -13
View File
@@ -24,7 +24,7 @@ export const NULL_CELL_CODE = 0;
/**
* Whitespace cell.
* This is meant as a replacement for empty cells when needed
* during rendering lines to preserve correct aligment.
* during rendering lines to preserve correct alignment.
*/
export const WHITESPACE_CELL_CHAR = ' ';
export const WHITESPACE_CELL_WIDTH = 1;
@@ -36,18 +36,18 @@ export const WHITESPACE_CELL_CODE = 32;
export const enum Content {
/**
* bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)
* read: `codepoint = content & Content.codepointMask;`
* write: `content |= codepoint & Content.codepointMask;`
* read: `codepoint = content & Content.CODEPOINT_MASK;`
* write: `content |= codepoint & Content.CODEPOINT_MASK;`
* shortcut if precondition `codepoint <= 0x10FFFF` is met:
* `content |= codepoint;`
*/
CODEPOINT_MASK = 0x1FFFFF,
/**
* bit 22 flag indication whether a cell contains combined content
* read: `isCombined = content & Content.isCombined;`
* set: `content |= Content.isCombined;`
* clear: `content &= ~Content.isCombined;`
* bit 22 flag indicating whether a cell contains combined content
* read: `isCombined = content & Content.IS_COMBINED_MASK;`
* set: `content |= Content.IS_COMBINED_MASK;`
* clear: `content &= ~Content.IS_COMBINED_MASK;`
*/
IS_COMBINED_MASK = 0x200000, // 1 << 21
@@ -55,19 +55,19 @@ export const enum Content {
* bit 1..22 mask to check whether a cell contains any string data
* we need to check for codepoint and isCombined bits to see
* whether a cell contains anything
* read: `isEmpty = !(content & Content.hasContent)`
* read: `isEmpty = !(content & Content.HAS_CONTENT_MASK)`
*/
HAS_CONTENT_MASK = 0x3FFFFF,
/**
* bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)
* read: `width = (content & Content.widthMask) >> Content.widthShift;`
* `hasWidth = content & Content.widthMask;`
* read: `width = (content & Content.WIDTH_MASK) >> Content.WIDTH_SHIFT;`
* `hasWidth = content & Content.WIDTH_MASK;`
* as long as wcwidth is highest value in `content`:
* `width = content >> Content.widthShift;`
* write: `content |= (width << Content.widthShift) & Content.widthMask;`
* `width = content >> Content.WIDTH_SHIFT;`
* write: `content |= (width << Content.WIDTH_SHIFT) & Content.WIDTH_MASK;`
* shortcut if precondition `0 <= width <= 3` is met:
* `content |= width << Content.widthShift;`
* `content |= width << Content.WIDTH_SHIFT;`
*/
WIDTH_MASK = 0xC00000, // 3 << 22
WIDTH_SHIFT = 22
+1 -1
View File
@@ -30,7 +30,7 @@ export class Marker implements IMarker {
}
this.isDisposed = true;
this.line = -1;
// Emit before super.dispose such that dispose listeners get a change to react
// Emit before super.dispose such that dispose listeners get a chance to react
this._onDispose.fire();
dispose(this._disposables);
this._disposables.length = 0;
+1 -1
View File
@@ -46,7 +46,7 @@ export function evaluateKeyboardEvent(
// Whether to cancel event propagation (NOTE: this may not be needed since the event is
// canceled at the end of keyDown
cancel: false,
// The new key even to emit
// The new key event to emit
key: undefined
};
const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0);
+1 -1
View File
@@ -267,7 +267,7 @@ export class WriteBuffer extends Disposable {
* this condition here, also the renderer has no way to spot nonsense updates either.
* FIXME: A proper fix for this would track the FPS at the renderer entry level separately.
*
* If favoring of FPS shows bad throughtput impact, use the following instead. It favors
* If favoring of FPS shows bad throughput impact, use the following instead. It favors
* throughput by eval'ing `startTime` upfront pulling at least one more chunk into the
* current microtask queue (executed before setTimeout).
*/
+2 -2
View File
@@ -18,7 +18,7 @@ import { ApcParser } from './ApcParser';
// @vt: #Y ESC CSI "Control Sequence Introducer" "ESC [" "Start of a CSI sequence."
// @vt: #Y ESC OSC "Operating System Command" "ESC ]" "Start of an OSC sequence."
// @vt: #Y ESC DCS "Device Control String" "ESC P" "Start of a DCS sequence."
// @vt: #Y ESC ST "String Terminator" "ESC \" "Terminator used for string type sequences."
// @vt: #Y ESC ST "String Terminator" "ESC \\" "Terminator used for string type sequences."
// @vt: #Y ESC PM "Privacy Message" "ESC ^" "Start of a privacy message."
// @vt: #Y ESC APC "Application Program Command" "ESC _" "Start of an APC sequence."
// @vt: #Y C1 CSI "Control Sequence Introducer" "\x9B" "Start of a CSI sequence."
@@ -243,7 +243,7 @@ export const VT500_TRANSITION_TABLE = (function (): TransitionTable {
*
* This parser is currently hardcoded to operate in ZDM (Zero Default Mode)
* as suggested by the original parser, thus empty parameters are set to 0.
* This this is not in line with the latest ECMA-48 specification
* This is not in line with the latest ECMA-48 specification
* (ZDM was part of the early specs and got completely removed later on).
*
* Other than the original parser from vt100.net this parser supports
+1 -1
View File
@@ -172,7 +172,7 @@ export class Params implements IParams {
* Add a sub parameter value.
* The sub parameter is automatically associated with the last parameter value.
* Thus it is not possible to add a subparameter without any parameter added yet.
* `Params` only stores up to `subParamsLength` sub parameters, any later
* `Params` only stores up to `maxSubParamsLength` sub parameters, any later
* sub parameter will be ignored.
*/
public addSubParam(value: number): void {
+2 -2
View File
@@ -234,8 +234,8 @@ export interface IApcParser extends ISubParser<IApcHandler, ApcFallbackHandlerTy
/**
* Interface to denote a specific ESC, CSI or DCS handler slot.
* The values are used to create an integer respresentation during handler
* regristation before passed to the subparsers as `ident`.
* The values are used to create an integer representation during handler
* registration before passed to the subparsers as `ident`.
* The integer translation is made to allow a faster handler access
* in `EscapeSequenceParser.parse`.
*/
+1 -1
View File
@@ -126,7 +126,7 @@ const DEFAULT_ENCODINGS: { [key: string]: CoreMouseEncoding } = {
*/
DEFAULT: (e: ICoreMouseEvent) => {
const params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];
// supress mouse report if we exceed addressible range
// suppress mouse report if we exceed addressable range
// Note this is handled differently by emulators
// - xterm: sends 0;0 coords instead
// - vte, konsole: no report
+3 -3
View File
@@ -324,7 +324,7 @@ export interface IOscLinkService {
* bit 0: shouldJoin - should combine with preceding character.
* bit 1..2: wcwidth - see UnicodeCharWidth.
* bit 3..31: class of character (currently only 4 bits are used).
* This is used to determined grapheme clustering - i.e. which codepoints
* This is used to determine grapheme clustering - i.e. which codepoints
* are to be combined into a single compound character.
*
* Use the UnicodeService static function createPropertyValue to create a
@@ -344,13 +344,13 @@ export type UnicodeCharWidth = 0 | 1 | 2;
export const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');
export interface IUnicodeService {
serviceBrand: undefined;
/** Register an Unicode version provider. */
/** Register a Unicode version provider. */
register(provider: IUnicodeVersionProvider): void;
/** Registered Unicode versions. */
readonly versions: string[];
/** Currently active version. */
activeVersion: string;
/** Event triggered, when activate version changed. */
/** Event triggered when the active version changes. */
readonly onChange: IEvent<string>;
/**
+1 -1
View File
@@ -980,7 +980,7 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void
});
test.describe('selectionInactiveBackground', async () => {
test('should render the the inactive selection when not focused', async () => {
test('should render the inactive selection when not focused', async () => {
const theme: ITheme = {
selectionBackground: '#FF000080',
selectionInactiveBackground: '#0000FF80'