Set allowProposedApi default to false

Fixes #2826
This commit is contained in:
Daniel Imms
2022-07-27 08:20:54 -07:00
parent fafa7efd5e
commit 238a2bafb1
6 changed files with 18 additions and 17 deletions
@@ -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);
+1
View File
@@ -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',
+1 -1
View File
@@ -33,7 +33,7 @@ export const DEFAULT_OPTIONS: Readonly<ITerminalOptions> = {
macOptionClickForcesSelection: false,
minimumContrastRatio: 1,
disableStdin: false,
allowProposedApi: true,
allowProposedApi: false,
allowTransparency: false,
tabStopWidth: 8,
theme: {},
+11 -11
View File
@@ -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');
+3 -3
View File
@@ -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)`);
+1 -1
View File
@@ -44,7 +44,7 @@ export async function timeout(ms: number): Promise<void> {
}
export async function openTerminal(page: playwright.Page, options: ITerminalOptions = {}): Promise<void> {
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');