Skip to content

Commit 73e3357

Browse files
authored
Merge pull request #5579 from Tyriar/proposed
Make everything except unicode APIs stable
2 parents 483c7b4 + 7389a10 commit 73e3357

6 files changed

Lines changed: 16 additions & 27 deletions

File tree

src/browser/public/Terminal.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export class Terminal extends Disposable implements ITerminalApi {
103103
return this._buffer;
104104
}
105105
public get markers(): ReadonlyArray<IMarker> {
106-
this._checkProposedApi();
107106
return this._core.markers;
108107
}
109108
public get modes(): IModes {
@@ -166,19 +165,16 @@ export class Terminal extends Disposable implements ITerminalApi {
166165
return this._core.registerLinkProvider(linkProvider);
167166
}
168167
public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
169-
this._checkProposedApi();
170168
return this._core.registerCharacterJoiner(handler);
171169
}
172170
public deregisterCharacterJoiner(joinerId: number): void {
173-
this._checkProposedApi();
174171
this._core.deregisterCharacterJoiner(joinerId);
175172
}
176173
public registerMarker(cursorYOffset: number = 0): IMarker {
177174
this._verifyIntegers(cursorYOffset);
178175
return this._core.registerMarker(cursorYOffset);
179176
}
180177
public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {
181-
this._checkProposedApi();
182178
this._verifyPositiveIntegers(decorationOptions.x ?? 0, decorationOptions.width ?? 0, decorationOptions.height ?? 0);
183179
return this._core.registerDecoration(decorationOptions);
184180
}

src/headless/public/Terminal.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('Headless API Tests', function (): void {
2222

2323
it('Proposed API check', async () => {
2424
term = new Terminal({ allowProposedApi: false });
25-
throws(() => term.markers, (error: any) => error.message === 'You must set the allowProposedApi option to true to use proposed API');
25+
throws(() => term.unicode, (error: any) => error.message === 'You must set the allowProposedApi option to true to use proposed API');
2626
});
2727

2828
it('write', async () => {

src/headless/public/Terminal.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export class Terminal extends Disposable implements ITerminalApi {
8484
public get onWriteParsed(): Event<void> { return this._core.onWriteParsed; }
8585

8686
public get parser(): IParser {
87-
this._checkProposedApi();
8887
if (!this._parser) {
8988
this._parser = new ParserApi(this._core);
9089
}
@@ -97,14 +96,12 @@ export class Terminal extends Disposable implements ITerminalApi {
9796
public get rows(): number { return this._core.rows; }
9897
public get cols(): number { return this._core.cols; }
9998
public get buffer(): IBufferNamespaceApi {
100-
this._checkProposedApi();
10199
if (!this._buffer) {
102100
this._buffer = this._register(new BufferNamespaceApi(this._core));
103101
}
104102
return this._buffer;
105103
}
106104
public get markers(): ReadonlyArray<IMarker> {
107-
this._checkProposedApi();
108105
return this._core.markers;
109106
}
110107
public get modes(): IModes {
@@ -146,7 +143,6 @@ export class Terminal extends Disposable implements ITerminalApi {
146143
this._core.resize(columns, rows);
147144
}
148145
public registerMarker(cursorYOffset: number = 0): IMarker | undefined {
149-
this._checkProposedApi();
150146
this._verifyIntegers(cursorYOffset);
151147
return this._core.addMarker(cursorYOffset);
152148
}

test/playwright/Terminal.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test.describe('API Integration Tests', () => {
2525
await openTerminal(ctx, { allowProposedApi: false }, { loadUnicodeGraphemesAddon: false });
2626
await ctx.page.evaluate(`
2727
try {
28-
window.term.markers;
28+
window.term.unicode;
2929
} catch (e) {
3030
window.throwMessage = e.message;
3131
}

typings/xterm-headless.d.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -584,21 +584,18 @@ declare module '@xterm/headless' {
584584
readonly cols: number;
585585

586586
/**
587-
* (EXPERIMENTAL) The terminal's current buffer, this might be either the
588-
* normal buffer or the alt buffer depending on what's running in the
589-
* terminal.
587+
* Access to the terminal's normal and alt buffer.
590588
*/
591589
readonly buffer: IBufferNamespace;
592590

593591
/**
594-
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
595-
* buffer is active this will always return [].
592+
* Get all markers registered against the buffer. If the alt buffer is
593+
* active this will always return [].
596594
*/
597595
readonly markers: ReadonlyArray<IMarker>;
598596

599597
/**
600-
* (EXPERIMENTAL) Get the parser interface to register
601-
* custom escape sequence handlers.
598+
* Get the parser interface to register custom escape sequence handlers.
602599
*/
603600
readonly parser: IParser;
604601

typings/xterm.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,8 @@ declare module '@xterm/xterm' {
856856
readonly buffer: IBufferNamespace;
857857

858858
/**
859-
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
860-
* buffer is active this will always return [].
859+
* Get all markers registered against the buffer. If the alt buffer is
860+
* active this will always return [].
861861
*/
862862
readonly markers: ReadonlyArray<IMarker>;
863863

@@ -867,8 +867,8 @@ declare module '@xterm/xterm' {
867867
readonly parser: IParser;
868868

869869
/**
870-
* (EXPERIMENTAL) Get the Unicode handling interface
871-
* to register and switch Unicode version.
870+
* (EXPERIMENTAL) Get the Unicode handling interface to register and switch
871+
* Unicode version.
872872
*/
873873
readonly unicode: IUnicodeHandling;
874874

@@ -1129,9 +1129,9 @@ declare module '@xterm/xterm' {
11291129
registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
11301130

11311131
/**
1132-
* (EXPERIMENTAL) Registers a character joiner, allowing custom sequences of
1133-
* characters to be rendered as a single unit. This is useful in particular
1134-
* for rendering ligatures and graphemes, among other things.
1132+
* Registers a character joiner, allowing custom sequences of characters to
1133+
* be rendered as a single unit. This is useful in particular for rendering
1134+
* ligatures and graphemes, among other things.
11351135
*
11361136
* Each registered character joiner is called with a string of text
11371137
* representing a portion of a line in the terminal that can be rendered as
@@ -1160,8 +1160,8 @@ declare module '@xterm/xterm' {
11601160
registerCharacterJoiner(handler: (text: string) => [number, number][]): number;
11611161

11621162
/**
1163-
* (EXPERIMENTAL) Deregisters the character joiner if one was registered.
1164-
* NOTE: character joiners are only used by the webgl renderer.
1163+
* Deregisters the character joiner if one was registered. Note that
1164+
* character joiners are only used by the webgl renderer.
11651165
* @param joinerId The character joiner's ID (returned after register)
11661166
*/
11671167
deregisterCharacterJoiner(joinerId: number): void;
@@ -1174,7 +1174,7 @@ declare module '@xterm/xterm' {
11741174
registerMarker(cursorYOffset?: number): IMarker;
11751175

11761176
/**
1177-
* (EXPERIMENTAL) Adds a decoration to the terminal using
1177+
* Registers a decoration to the terminal.
11781178
* @param decorationOptions, which takes a marker and an optional anchor,
11791179
* width, height, and x offset from the anchor. Returns the decoration or
11801180
* undefined if the alt buffer is active or the marker has already been

0 commit comments

Comments
 (0)