diff --git a/addons/xterm-addon-serialize/src/SerializeAddon.test.ts b/addons/xterm-addon-serialize/src/SerializeAddon.test.ts index 67b83884..05f2c61c 100644 --- a/addons/xterm-addon-serialize/src/SerializeAddon.test.ts +++ b/addons/xterm-addon-serialize/src/SerializeAddon.test.ts @@ -74,7 +74,7 @@ describe('xterm-addon-serialize', () => { } }); - terminal = new Terminal({ cols: 10, rows: 2 }); + terminal = new Terminal({ cols: 10, rows: 2, allowProposedApi: true }); terminal.loadAddon(serializeAddon); selectionService = new TestSelectionService((terminal as any)._core._bufferService); diff --git a/demo/client.ts b/demo/client.ts index 66ba7bd7..adbbd85a 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -194,6 +194,7 @@ function createTerminal(): void { const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0; term = new Terminal({ + allowProposedApi: true, allowTransparency: true, windowsMode: isWindows, fontFamily: 'Fira Code, courier-new, courier, monospace', diff --git a/src/common/services/OptionsService.ts b/src/common/services/OptionsService.ts index a8c4ff75..4889f120 100644 --- a/src/common/services/OptionsService.ts +++ b/src/common/services/OptionsService.ts @@ -33,7 +33,7 @@ export const DEFAULT_OPTIONS: Readonly = { macOptionClickForcesSelection: false, minimumContrastRatio: 1, disableStdin: false, - allowProposedApi: true, + allowProposedApi: false, allowTransparency: false, tabStopWidth: 8, theme: {}, diff --git a/src/headless/public/Terminal.test.ts b/src/headless/public/Terminal.test.ts index a65d8775..403cf35a 100644 --- a/src/headless/public/Terminal.test.ts +++ b/src/headless/public/Terminal.test.ts @@ -12,7 +12,7 @@ let term: Terminal; describe('Headless API Tests', function (): void { beforeEach(() => { // Create default terminal to be used by most tests - term = new Terminal(); + term = new Terminal({ allowProposedApi: true }); }); it('Default options', async () => { @@ -102,7 +102,7 @@ describe('Headless API Tests', function (): void { }); it('clear', async () => { - term = new Terminal({ rows: 5 }); + term = new Terminal({ rows: 5, allowProposedApi: true }); for (let i = 0; i < 10; i++) { await writeSync('\n\rtest' + i); } @@ -254,7 +254,7 @@ describe('Headless API Tests', function (): void { describe('buffer', () => { it('cursorX, cursorY', async () => { - term = new Terminal({ rows: 5, cols: 5 }); + term = new Terminal({ rows: 5, cols: 5, allowProposedApi: true }); strictEqual(term.buffer.active.cursorX, 0); strictEqual(term.buffer.active.cursorY, 0); await writeSync('foo'); @@ -275,7 +275,7 @@ describe('Headless API Tests', function (): void { }); it('viewportY', async () => { - term = new Terminal({ rows: 5 }); + term = new Terminal({ rows: 5, allowProposedApi: true }); strictEqual(term.buffer.active.viewportY, 0); await writeSync('\n\n\n\n'); strictEqual(term.buffer.active.viewportY, 0); @@ -290,7 +290,7 @@ describe('Headless API Tests', function (): void { }); it('baseY', async () => { - term = new Terminal({ rows: 5 }); + term = new Terminal({ rows: 5, allowProposedApi: true }); strictEqual(term.buffer.active.baseY, 0); await writeSync('\n\n\n\n'); strictEqual(term.buffer.active.baseY, 0); @@ -305,7 +305,7 @@ describe('Headless API Tests', function (): void { }); it('length', async () => { - term = new Terminal({ rows: 5 }); + term = new Terminal({ rows: 5, allowProposedApi: true }); strictEqual(term.buffer.active.length, 5); await writeSync('\n\n\n\n'); strictEqual(term.buffer.active.length, 5); @@ -317,13 +317,13 @@ describe('Headless API Tests', function (): void { describe('getLine', () => { it('invalid index', async () => { - term = new Terminal({ rows: 5 }); + term = new Terminal({ rows: 5, allowProposedApi: true }); strictEqual(term.buffer.active.getLine(-1), undefined); strictEqual(term.buffer.active.getLine(5), undefined); }); it('isWrapped', async () => { - term = new Terminal({ cols: 5 }); + term = new Terminal({ cols: 5, allowProposedApi: true }); strictEqual(term.buffer.active.getLine(0)!.isWrapped, false); strictEqual(term.buffer.active.getLine(1)!.isWrapped, false); await writeSync('abcde'); @@ -335,7 +335,7 @@ describe('Headless API Tests', function (): void { }); it('translateToString', async () => { - term = new Terminal({ cols: 5 }); + term = new Terminal({ cols: 5, allowProposedApi: true }); strictEqual(term.buffer.active.getLine(0)!.translateToString(), ' '); strictEqual(term.buffer.active.getLine(0)!.translateToString(true), ''); await writeSync('foo'); @@ -350,7 +350,7 @@ describe('Headless API Tests', function (): void { }); it('getCell', async () => { - term = new Terminal({ cols: 5 }); + term = new Terminal({ cols: 5, allowProposedApi: true }); strictEqual(term.buffer.active.getLine(0)!.getCell(-1), undefined); strictEqual(term.buffer.active.getLine(0)!.getCell(5), undefined); strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getChars(), ''); @@ -366,7 +366,7 @@ describe('Headless API Tests', function (): void { }); it('active, normal, alternate', async () => { - term = new Terminal({ cols: 5 }); + term = new Terminal({ cols: 5, allowProposedApi: true }); strictEqual(term.buffer.active.type, 'normal'); strictEqual(term.buffer.normal.type, 'normal'); strictEqual(term.buffer.alternate.type, 'alternate'); diff --git a/test/api/Terminal.api.ts b/test/api/Terminal.api.ts index 3a023d4a..0e1f7764 100644 --- a/test/api/Terminal.api.ts +++ b/test/api/Terminal.api.ts @@ -734,7 +734,7 @@ describe('API Integration Tests', function(): void { describe('registerDecoration', () => { describe('bufferDecorations', () => { it('should register decorations and render them when terminal open is called', async () => { - await page.evaluate(`window.term = new Terminal({})`); + await page.evaluate(`window.term = new Terminal({ allowProposedApi: true })`); await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`); await page.waitForSelector('.xterm-text-layer'); await page.evaluate(`window.marker1 = window.term.addMarker(1)`); @@ -765,7 +765,7 @@ describe('API Integration Tests', function(): void { }); describe('overviewRulerDecorations', () => { it('should not add an overview ruler when width is not set', async () => { - await page.evaluate(`window.term = new Terminal({})`); + await page.evaluate(`window.term = new Terminal({ allowProposedApi: true })`); await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`); await page.waitForSelector('.xterm-text-layer'); await page.evaluate(`window.marker1 = window.term.addMarker(1)`); @@ -776,7 +776,7 @@ describe('API Integration Tests', function(): void { await pollFor(page, `document.querySelectorAll('.xterm-decoration-overview-ruler').length`, 0); }); it('should add an overview ruler when width is set', async () => { - await page.evaluate(`window.term = new Terminal({ overviewRulerWidth: 15 })`); + await page.evaluate(`window.term = new Terminal({ allowProposedApi: true, overviewRulerWidth: 15 })`); await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`); await page.waitForSelector('.xterm-text-layer'); await page.evaluate(`window.marker1 = window.term.addMarker(1)`); diff --git a/test/api/TestUtils.ts b/test/api/TestUtils.ts index 2acc4d09..e059c92c 100644 --- a/test/api/TestUtils.ts +++ b/test/api/TestUtils.ts @@ -44,7 +44,7 @@ export async function timeout(ms: number): Promise { } export async function openTerminal(page: playwright.Page, options: ITerminalOptions = {}): Promise { - await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`); + await page.evaluate(`window.term = new Terminal(${JSON.stringify({ allowProposedApi: true, ...options })})`); await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`); if (options.rendererType === 'dom') { await page.waitForSelector('.xterm-rows');