Skip to content

Commit 1400736

Browse files
authored
Merge pull request #3945 from Tyriar/v5_proposed_api
Set allowProposedApi default to false
2 parents 09672fe + 238a2ba commit 1400736

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

addons/xterm-addon-serialize/src/SerializeAddon.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('xterm-addon-serialize', () => {
7474
}
7575
});
7676

77-
terminal = new Terminal({ cols: 10, rows: 2 });
77+
terminal = new Terminal({ cols: 10, rows: 2, allowProposedApi: true });
7878
terminal.loadAddon(serializeAddon);
7979

8080
selectionService = new TestSelectionService((terminal as any)._core._bufferService);

demo/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ function createTerminal(): void {
194194

195195
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0;
196196
term = new Terminal({
197+
allowProposedApi: true,
197198
allowTransparency: true,
198199
windowsMode: isWindows,
199200
fontFamily: 'Fira Code, courier-new, courier, monospace',

src/common/services/OptionsService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const DEFAULT_OPTIONS: Readonly<ITerminalOptions> = {
3333
macOptionClickForcesSelection: false,
3434
minimumContrastRatio: 1,
3535
disableStdin: false,
36-
allowProposedApi: true,
36+
allowProposedApi: false,
3737
allowTransparency: false,
3838
tabStopWidth: 8,
3939
theme: {},

src/headless/public/Terminal.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let term: Terminal;
1212
describe('Headless API Tests', function (): void {
1313
beforeEach(() => {
1414
// Create default terminal to be used by most tests
15-
term = new Terminal();
15+
term = new Terminal({ allowProposedApi: true });
1616
});
1717

1818
it('Default options', async () => {
@@ -102,7 +102,7 @@ describe('Headless API Tests', function (): void {
102102
});
103103

104104
it('clear', async () => {
105-
term = new Terminal({ rows: 5 });
105+
term = new Terminal({ rows: 5, allowProposedApi: true });
106106
for (let i = 0; i < 10; i++) {
107107
await writeSync('\n\rtest' + i);
108108
}
@@ -254,7 +254,7 @@ describe('Headless API Tests', function (): void {
254254

255255
describe('buffer', () => {
256256
it('cursorX, cursorY', async () => {
257-
term = new Terminal({ rows: 5, cols: 5 });
257+
term = new Terminal({ rows: 5, cols: 5, allowProposedApi: true });
258258
strictEqual(term.buffer.active.cursorX, 0);
259259
strictEqual(term.buffer.active.cursorY, 0);
260260
await writeSync('foo');
@@ -275,7 +275,7 @@ describe('Headless API Tests', function (): void {
275275
});
276276

277277
it('viewportY', async () => {
278-
term = new Terminal({ rows: 5 });
278+
term = new Terminal({ rows: 5, allowProposedApi: true });
279279
strictEqual(term.buffer.active.viewportY, 0);
280280
await writeSync('\n\n\n\n');
281281
strictEqual(term.buffer.active.viewportY, 0);
@@ -290,7 +290,7 @@ describe('Headless API Tests', function (): void {
290290
});
291291

292292
it('baseY', async () => {
293-
term = new Terminal({ rows: 5 });
293+
term = new Terminal({ rows: 5, allowProposedApi: true });
294294
strictEqual(term.buffer.active.baseY, 0);
295295
await writeSync('\n\n\n\n');
296296
strictEqual(term.buffer.active.baseY, 0);
@@ -305,7 +305,7 @@ describe('Headless API Tests', function (): void {
305305
});
306306

307307
it('length', async () => {
308-
term = new Terminal({ rows: 5 });
308+
term = new Terminal({ rows: 5, allowProposedApi: true });
309309
strictEqual(term.buffer.active.length, 5);
310310
await writeSync('\n\n\n\n');
311311
strictEqual(term.buffer.active.length, 5);
@@ -317,13 +317,13 @@ describe('Headless API Tests', function (): void {
317317

318318
describe('getLine', () => {
319319
it('invalid index', async () => {
320-
term = new Terminal({ rows: 5 });
320+
term = new Terminal({ rows: 5, allowProposedApi: true });
321321
strictEqual(term.buffer.active.getLine(-1), undefined);
322322
strictEqual(term.buffer.active.getLine(5), undefined);
323323
});
324324

325325
it('isWrapped', async () => {
326-
term = new Terminal({ cols: 5 });
326+
term = new Terminal({ cols: 5, allowProposedApi: true });
327327
strictEqual(term.buffer.active.getLine(0)!.isWrapped, false);
328328
strictEqual(term.buffer.active.getLine(1)!.isWrapped, false);
329329
await writeSync('abcde');
@@ -335,7 +335,7 @@ describe('Headless API Tests', function (): void {
335335
});
336336

337337
it('translateToString', async () => {
338-
term = new Terminal({ cols: 5 });
338+
term = new Terminal({ cols: 5, allowProposedApi: true });
339339
strictEqual(term.buffer.active.getLine(0)!.translateToString(), ' ');
340340
strictEqual(term.buffer.active.getLine(0)!.translateToString(true), '');
341341
await writeSync('foo');
@@ -350,7 +350,7 @@ describe('Headless API Tests', function (): void {
350350
});
351351

352352
it('getCell', async () => {
353-
term = new Terminal({ cols: 5 });
353+
term = new Terminal({ cols: 5, allowProposedApi: true });
354354
strictEqual(term.buffer.active.getLine(0)!.getCell(-1), undefined);
355355
strictEqual(term.buffer.active.getLine(0)!.getCell(5), undefined);
356356
strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getChars(), '');
@@ -366,7 +366,7 @@ describe('Headless API Tests', function (): void {
366366
});
367367

368368
it('active, normal, alternate', async () => {
369-
term = new Terminal({ cols: 5 });
369+
term = new Terminal({ cols: 5, allowProposedApi: true });
370370
strictEqual(term.buffer.active.type, 'normal');
371371
strictEqual(term.buffer.normal.type, 'normal');
372372
strictEqual(term.buffer.alternate.type, 'alternate');

test/api/Terminal.api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ describe('API Integration Tests', function(): void {
734734
describe('registerDecoration', () => {
735735
describe('bufferDecorations', () => {
736736
it('should register decorations and render them when terminal open is called', async () => {
737-
await page.evaluate(`window.term = new Terminal({})`);
737+
await page.evaluate(`window.term = new Terminal({ allowProposedApi: true })`);
738738
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
739739
await page.waitForSelector('.xterm-text-layer');
740740
await page.evaluate(`window.marker1 = window.term.addMarker(1)`);
@@ -765,7 +765,7 @@ describe('API Integration Tests', function(): void {
765765
});
766766
describe('overviewRulerDecorations', () => {
767767
it('should not add an overview ruler when width is not set', async () => {
768-
await page.evaluate(`window.term = new Terminal({})`);
768+
await page.evaluate(`window.term = new Terminal({ allowProposedApi: true })`);
769769
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
770770
await page.waitForSelector('.xterm-text-layer');
771771
await page.evaluate(`window.marker1 = window.term.addMarker(1)`);
@@ -776,7 +776,7 @@ describe('API Integration Tests', function(): void {
776776
await pollFor(page, `document.querySelectorAll('.xterm-decoration-overview-ruler').length`, 0);
777777
});
778778
it('should add an overview ruler when width is set', async () => {
779-
await page.evaluate(`window.term = new Terminal({ overviewRulerWidth: 15 })`);
779+
await page.evaluate(`window.term = new Terminal({ allowProposedApi: true, overviewRulerWidth: 15 })`);
780780
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
781781
await page.waitForSelector('.xterm-text-layer');
782782
await page.evaluate(`window.marker1 = window.term.addMarker(1)`);

test/api/TestUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function timeout(ms: number): Promise<void> {
4444
}
4545

4646
export async function openTerminal(page: playwright.Page, options: ITerminalOptions = {}): Promise<void> {
47-
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
47+
await page.evaluate(`window.term = new Terminal(${JSON.stringify({ allowProposedApi: true, ...options })})`);
4848
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
4949
if (options.rendererType === 'dom') {
5050
await page.waitForSelector('.xterm-rows');

0 commit comments

Comments
 (0)