Merge branch 'master' into cursor/cross-cutting-doc-comments-cf99

This commit is contained in:
Daniel Imms
2026-06-01 08:35:08 -07:00
committed by GitHub
17 changed files with 33 additions and 33 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
private _keyDownHandled: boolean = false; 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". * is currently "pressed".
*/ */
private _keyDownSeen: boolean = false; private _keyDownSeen: boolean = false;
+1 -1
View File
@@ -47,7 +47,7 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
// enough time to pass before refreshing again. // enough time to pass before refreshing again.
const refreshRequestTime: number = performance.now(); const refreshRequestTime: number = performance.now();
if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) { 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._lastRefreshMs = refreshRequestTime;
this._innerRefresh(); this._innerRefresh();
} else if (!this._additionalRefreshRequested) { } 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. * 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 { 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) { if (!hasValidCharSize) {
return undefined; return undefined;
} }
@@ -45,7 +45,7 @@ export function getCoords(window: Pick<Window, 'getComputedStyle'>, event: Pick<
coords[1] = Math.ceil(coords[1] / cssCellHeight); coords[1] = Math.ceil(coords[1] / cssCellHeight);
// Ensure coordinates are within the terminal viewport. Note that selections // 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). // cover half of one char and half of the next).
coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0)); coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));
coords[1] = Math.min(Math.max(coords[1], 1), rowCount); coords[1] = Math.min(Math.max(coords[1], 1), rowCount);
+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]); colors.ansi[i + 16] = parseColor(theme.extendedAnsi[i], DEFAULT_ANSI_COLORS[i + 16]);
} }
} }
// Clear our the cache // Clear the cache
this._contrastCache.clear(); this._contrastCache.clear();
this._halfContrastCache.clear(); this._halfContrastCache.clear();
this._updateRestoreColors(); 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. * Gets the contrast ratio between two relative luminance values.
* @param l1 The first relative luminance. * @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 * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
*/ */
export function contrastRatio(l1: number, l2: number): number { export function contrastRatio(l1: number, l2: number): number {
+1 -1
View File
@@ -44,7 +44,7 @@ export function getSafariVersion(): number {
return parseInt(majorVersion[1], 10); 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. // and ISO third level shifts.
// http://stackoverflow.com/q/19877924/577598 // http://stackoverflow.com/q/19877924/577598
export const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform); 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 { interface ITaskQueue {
/** /**
* Adds a task to the queue which will run in a future idle callback. * 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 * should split their work into smaller pieces and return `true` to get
* called again until the work is done (on falsy return value). * called again until the work is done (on falsy return value).
*/ */
+1 -1
View File
@@ -181,7 +181,7 @@ export interface ICoreMouseEvent {
x: number; x: number;
y: 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. * it is not possible to report multiple buttons at once.
* Wheel is treated as a button. * Wheel is treated as a button.
* There are invalid combinations of buttons and actions possible * There are invalid combinations of buttons and actions possible
+2 -2
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 { public clear(): void {
this._stringCache.clear(); this._stringCache.clear();
@@ -197,7 +197,7 @@ export class Buffer extends Disposable implements IBuffer {
for (let y = this._rows; y < newRows; y++) { for (let y = this._rows; y < newRows; y++) {
if (this.lines.length < newRows + this.ybase) { if (this.lines.length < newRows + this.ybase) {
if (this._optionsService.rawOptions.windowsPty.backend !== undefined || this._optionsService.rawOptions.windowsPty.buildNumber !== undefined) { 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 // view of the world. Once a line enters scrollback for conpty it remains there
this.lines.push(new BufferLine(this._stringCache, newCols, nullCell, false)); this.lines.push(new BufferLine(this._stringCache, newCols, nullCell, false));
} else { } else {
+12 -12
View File
@@ -24,7 +24,7 @@ export const NULL_CELL_CODE = 0;
/** /**
* Whitespace cell. * Whitespace cell.
* This is meant as a replacement for empty cells when needed * 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_CHAR = ' ';
export const WHITESPACE_CELL_WIDTH = 1; export const WHITESPACE_CELL_WIDTH = 1;
@@ -36,8 +36,8 @@ export const WHITESPACE_CELL_CODE = 32;
export const enum Content { export const enum Content {
/** /**
* bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken) * bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)
* read: `codepoint = content & Content.codepointMask;` * read: `codepoint = content & Content.CODEPOINT_MASK;`
* write: `content |= codepoint & Content.codepointMask;` * write: `content |= codepoint & Content.CODEPOINT_MASK;`
* shortcut if precondition `codepoint <= 0x10FFFF` is met: * shortcut if precondition `codepoint <= 0x10FFFF` is met:
* `content |= codepoint;` * `content |= codepoint;`
*/ */
@@ -45,9 +45,9 @@ export const enum Content {
/** /**
* bit 22 flag indicating whether a cell contains combined content * bit 22 flag indicating whether a cell contains combined content
* read: `isCombined = content & Content.isCombined;` * read: `isCombined = content & Content.IS_COMBINED_MASK;`
* set: `content |= Content.isCombined;` * set: `content |= Content.IS_COMBINED_MASK;`
* clear: `content &= ~Content.isCombined;` * clear: `content &= ~Content.IS_COMBINED_MASK;`
*/ */
IS_COMBINED_MASK = 0x200000, // 1 << 21 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 * bit 1..22 mask to check whether a cell contains any string data
* we need to check for codepoint and isCombined bits to see * we need to check for codepoint and isCombined bits to see
* whether a cell contains anything * whether a cell contains anything
* read: `isEmpty = !(content & Content.hasContent)` * read: `isEmpty = !(content & Content.HAS_CONTENT_MASK)`
*/ */
HAS_CONTENT_MASK = 0x3FFFFF, HAS_CONTENT_MASK = 0x3FFFFF,
/** /**
* bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2) * bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)
* read: `width = (content & Content.widthMask) >> Content.widthShift;` * read: `width = (content & Content.WIDTH_MASK) >> Content.WIDTH_SHIFT;`
* `hasWidth = content & Content.widthMask;` * `hasWidth = content & Content.WIDTH_MASK;`
* as long as wcwidth is highest value in `content`: * as long as wcwidth is highest value in `content`:
* `width = content >> Content.widthShift;` * `width = content >> Content.WIDTH_SHIFT;`
* write: `content |= (width << Content.widthShift) & Content.widthMask;` * write: `content |= (width << Content.WIDTH_SHIFT) & Content.WIDTH_MASK;`
* shortcut if precondition `0 <= width <= 3` is met: * shortcut if precondition `0 <= width <= 3` is met:
* `content |= width << Content.widthShift;` * `content |= width << Content.WIDTH_SHIFT;`
*/ */
WIDTH_MASK = 0xC00000, // 3 << 22 WIDTH_MASK = 0xC00000, // 3 << 22
WIDTH_SHIFT = 22 WIDTH_SHIFT = 22
+1 -1
View File
@@ -30,7 +30,7 @@ export class Marker implements IMarker {
} }
this.isDisposed = true; this.isDisposed = true;
this.line = -1; 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(); this._onDispose.fire();
dispose(this._disposables); dispose(this._disposables);
this._disposables.length = 0; 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 // Whether to cancel event propagation (NOTE: this may not be needed since the event is
// canceled at the end of keyDown // canceled at the end of keyDown
cancel: false, cancel: false,
// The new key even to emit // The new key event to emit
key: undefined key: undefined
}; };
const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0); 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. * 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. * 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 * throughput by eval'ing `startTime` upfront pulling at least one more chunk into the
* current microtask queue (executed before setTimeout). * 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 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 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 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 PM "Privacy Message" "ESC ^" "Start of a privacy message."
// @vt: #Y ESC APC "Application Program Command" "ESC _" "Start of an APC sequence." // @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." // @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) * 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. * 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). * (ZDM was part of the early specs and got completely removed later on).
* *
* Other than the original parser from vt100.net this parser supports * 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. * Add a sub parameter value.
* The sub parameter is automatically associated with the last 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. * 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. * sub parameter will be ignored.
*/ */
public addSubParam(value: number): void { 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. * Interface to denote a specific ESC, CSI or DCS handler slot.
* The values are used to create an integer respresentation during handler * The values are used to create an integer representation during handler
* regristation before passed to the subparsers as `ident`. * registration before passed to the subparsers as `ident`.
* The integer translation is made to allow a faster handler access * The integer translation is made to allow a faster handler access
* in `EscapeSequenceParser.parse`. * in `EscapeSequenceParser.parse`.
*/ */
+2 -2
View File
@@ -344,13 +344,13 @@ export type UnicodeCharWidth = 0 | 1 | 2;
export const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService'); export const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');
export interface IUnicodeService { export interface IUnicodeService {
serviceBrand: undefined; serviceBrand: undefined;
/** Register an Unicode version provider. */ /** Register a Unicode version provider. */
register(provider: IUnicodeVersionProvider): void; register(provider: IUnicodeVersionProvider): void;
/** Registered Unicode versions. */ /** Registered Unicode versions. */
readonly versions: string[]; readonly versions: string[];
/** Currently active version. */ /** Currently active version. */
activeVersion: string; activeVersion: string;
/** Event triggered, when activate version changed. */ /** Event triggered when the active version changes. */
readonly onChange: IEvent<string>; readonly onChange: IEvent<string>;
/** /**