Merge pull request #5579 from Tyriar/proposed

Make everything except unicode APIs stable
This commit is contained in:
Daniel Imms
2026-01-03 15:04:25 -08:00
committed by GitHub
6 changed files with 16 additions and 27 deletions
-4
View File
@@ -103,7 +103,6 @@ export class Terminal extends Disposable implements ITerminalApi {
return this._buffer;
}
public get markers(): ReadonlyArray<IMarker> {
this._checkProposedApi();
return this._core.markers;
}
public get modes(): IModes {
@@ -166,11 +165,9 @@ export class Terminal extends Disposable implements ITerminalApi {
return this._core.registerLinkProvider(linkProvider);
}
public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
this._checkProposedApi();
return this._core.registerCharacterJoiner(handler);
}
public deregisterCharacterJoiner(joinerId: number): void {
this._checkProposedApi();
this._core.deregisterCharacterJoiner(joinerId);
}
public registerMarker(cursorYOffset: number = 0): IMarker {
@@ -178,7 +175,6 @@ export class Terminal extends Disposable implements ITerminalApi {
return this._core.registerMarker(cursorYOffset);
}
public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {
this._checkProposedApi();
this._verifyPositiveIntegers(decorationOptions.x ?? 0, decorationOptions.width ?? 0, decorationOptions.height ?? 0);
return this._core.registerDecoration(decorationOptions);
}
+1 -1
View File
@@ -22,7 +22,7 @@ describe('Headless API Tests', function (): void {
it('Proposed API check', async () => {
term = new Terminal({ allowProposedApi: false });
throws(() => term.markers, (error: any) => error.message === 'You must set the allowProposedApi option to true to use proposed API');
throws(() => term.unicode, (error: any) => error.message === 'You must set the allowProposedApi option to true to use proposed API');
});
it('write', async () => {
-4
View File
@@ -84,7 +84,6 @@ export class Terminal extends Disposable implements ITerminalApi {
public get onWriteParsed(): Event<void> { return this._core.onWriteParsed; }
public get parser(): IParser {
this._checkProposedApi();
if (!this._parser) {
this._parser = new ParserApi(this._core);
}
@@ -97,14 +96,12 @@ export class Terminal extends Disposable implements ITerminalApi {
public get rows(): number { return this._core.rows; }
public get cols(): number { return this._core.cols; }
public get buffer(): IBufferNamespaceApi {
this._checkProposedApi();
if (!this._buffer) {
this._buffer = this._register(new BufferNamespaceApi(this._core));
}
return this._buffer;
}
public get markers(): ReadonlyArray<IMarker> {
this._checkProposedApi();
return this._core.markers;
}
public get modes(): IModes {
@@ -146,7 +143,6 @@ export class Terminal extends Disposable implements ITerminalApi {
this._core.resize(columns, rows);
}
public registerMarker(cursorYOffset: number = 0): IMarker | undefined {
this._checkProposedApi();
this._verifyIntegers(cursorYOffset);
return this._core.addMarker(cursorYOffset);
}
+1 -1
View File
@@ -25,7 +25,7 @@ test.describe('API Integration Tests', () => {
await openTerminal(ctx, { allowProposedApi: false }, { loadUnicodeGraphemesAddon: false });
await ctx.page.evaluate(`
try {
window.term.markers;
window.term.unicode;
} catch (e) {
window.throwMessage = e.message;
}
+4 -7
View File
@@ -584,21 +584,18 @@ declare module '@xterm/headless' {
readonly cols: number;
/**
* (EXPERIMENTAL) The terminal's current buffer, this might be either the
* normal buffer or the alt buffer depending on what's running in the
* terminal.
* Access to the terminal's normal and alt buffer.
*/
readonly buffer: IBufferNamespace;
/**
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
* buffer is active this will always return [].
* Get all markers registered against the buffer. If the alt buffer is
* active this will always return [].
*/
readonly markers: ReadonlyArray<IMarker>;
/**
* (EXPERIMENTAL) Get the parser interface to register
* custom escape sequence handlers.
* Get the parser interface to register custom escape sequence handlers.
*/
readonly parser: IParser;
+10 -10
View File
@@ -856,8 +856,8 @@ declare module '@xterm/xterm' {
readonly buffer: IBufferNamespace;
/**
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
* buffer is active this will always return [].
* Get all markers registered against the buffer. If the alt buffer is
* active this will always return [].
*/
readonly markers: ReadonlyArray<IMarker>;
@@ -867,8 +867,8 @@ declare module '@xterm/xterm' {
readonly parser: IParser;
/**
* (EXPERIMENTAL) Get the Unicode handling interface
* to register and switch Unicode version.
* (EXPERIMENTAL) Get the Unicode handling interface to register and switch
* Unicode version.
*/
readonly unicode: IUnicodeHandling;
@@ -1129,9 +1129,9 @@ declare module '@xterm/xterm' {
registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
/**
* (EXPERIMENTAL) Registers a character joiner, allowing custom sequences of
* characters to be rendered as a single unit. This is useful in particular
* for rendering ligatures and graphemes, among other things.
* Registers a character joiner, allowing custom sequences of characters to
* be rendered as a single unit. This is useful in particular for rendering
* ligatures and graphemes, among other things.
*
* Each registered character joiner is called with a string of text
* representing a portion of a line in the terminal that can be rendered as
@@ -1160,8 +1160,8 @@ declare module '@xterm/xterm' {
registerCharacterJoiner(handler: (text: string) => [number, number][]): number;
/**
* (EXPERIMENTAL) Deregisters the character joiner if one was registered.
* NOTE: character joiners are only used by the webgl renderer.
* Deregisters the character joiner if one was registered. Note that
* character joiners are only used by the webgl renderer.
* @param joinerId The character joiner's ID (returned after register)
*/
deregisterCharacterJoiner(joinerId: number): void;
@@ -1174,7 +1174,7 @@ declare module '@xterm/xterm' {
registerMarker(cursorYOffset?: number): IMarker;
/**
* (EXPERIMENTAL) Adds a decoration to the terminal using
* Registers a decoration to the terminal.
* @param decorationOptions, which takes a marker and an optional anchor,
* width, height, and x offset from the anchor. Returns the decoration or
* undefined if the alt buffer is active or the marker has already been