From 25a78c77f24f130a5a7154855b4c3c783cfbd325 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:11:17 -0700 Subject: [PATCH 1/7] Simplify cursor style types in webgl Fixes #4686 --- addons/xterm-addon-webgl/src/Types.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/xterm-addon-webgl/src/Types.d.ts b/addons/xterm-addon-webgl/src/Types.d.ts index 3eb3b300..fe6e10c7 100644 --- a/addons/xterm-addon-webgl/src/Types.d.ts +++ b/addons/xterm-addon-webgl/src/Types.d.ts @@ -4,6 +4,7 @@ */ import { ISelectionRenderModel } from 'browser/renderer/shared/Types'; +import { CursorInactiveStyle, CursorStyle } from 'common/Types'; export interface IRenderModel { cells: Uint32Array; @@ -16,13 +17,11 @@ export interface ICursorRenderModel { x: number; y: number; width: number; - style: CursorStyle; + style: CursorStyle | CursorInactiveStyle; cursorWidth: number; dpr: number; } -export type CursorStyle = 'outline' | 'block' | 'bar' | 'underline' | 'none'; - export interface IWebGL2RenderingContext extends WebGLRenderingContext { vertexAttribDivisor(index: number, divisor: number): void; createVertexArray(): IWebGLVertexArrayObject; From 0b32b42134a67ccb2a98c82c94ff822219d6cf95 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 19 Aug 2023 05:00:45 -0700 Subject: [PATCH 2/7] Improve lifecycle of WebLinksAddon.api Part of #4690 --- .../test/WebLinksAddon.api.ts | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts b/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts index 366d8160..d5864a9c 100644 --- a/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts +++ b/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts @@ -35,26 +35,32 @@ describe('WebLinksAddon', () => { browser = await launchBrowser(); page = await (await browser.newContext()).newPage(); await page.setViewportSize({ width, height }); + await page.goto(APP); + await openTerminal(page, { cols: 40 }); }); after(async () => await browser.close()); - beforeEach(async () => await page.goto(APP)); - - it('.com', async function(): Promise { - await testHostName('foo.com'); + beforeEach(async () => { + await page.evaluate(` + window._linkaddon?.dispose(); + window.term.reset(); + window._linkaddon = new window.WebLinksAddon(); + window.term.loadAddon(window._linkaddon); + `); }); - it('.com.au', async function(): Promise { - await testHostName('foo.com.au'); - }); - - it('.io', async function(): Promise { - await testHostName('foo.io'); - }); + it('.com', async () => await testHostName('foo.com')); + it('.com.au', async () => await testHostName('foo.com.au')); + it('.io', async () => await testHostName('foo.io')); describe('correct buffer offsets & uri', () => { + beforeEach(async () => { + await page.evaluate(` + window._linkStateData = {uri:''}; + window._linkaddon._options.hover = (event, uri, range) => { window._linkStateData = { uri, range }; }; + `); + }); it('all half width', async () => { - setupCustom(); await writeSync(page, 'aaa http://example.com aaa http://example.com aaa'); await resetAndHover(5, 0); await evalLinkStateData('http://example.com', { start: { x: 5, y: 1 }, end: { x: 22, y: 1 } }); @@ -62,7 +68,6 @@ describe('WebLinksAddon', () => { await evalLinkStateData('http://example.com', { start: { x: 28, y: 1 }, end: { x: 5, y: 2 } }); }); it('url after full width', async () => { - setupCustom(); await writeSync(page, '¥¥¥ http://example.com ¥¥¥ http://example.com aaa'); await resetAndHover(8, 0); await evalLinkStateData('http://example.com', { start: { x: 8, y: 1 }, end: { x: 25, y: 1 } }); @@ -70,7 +75,6 @@ describe('WebLinksAddon', () => { await evalLinkStateData('http://example.com', { start: { x: 34, y: 1 }, end: { x: 11, y: 2 } }); }); it('full width within url and before', async () => { - setupCustom(); await writeSync(page, '¥¥¥ https://ko.wikipedia.org/wiki/위키백과:대문 aaa https://ko.wikipedia.org/wiki/위키백과:대문 ¥¥¥'); await resetAndHover(8, 0); await evalLinkStateData('https://ko.wikipedia.org/wiki/위키백과:대문', { start: { x: 8, y: 1 }, end: { x: 11, y: 2 } }); @@ -80,7 +84,6 @@ describe('WebLinksAddon', () => { await evalLinkStateData('https://ko.wikipedia.org/wiki/위키백과:대문', { start: { x: 17, y: 2 }, end: { x: 19, y: 3 } }); }); it('name + password url after full width and combining', async () => { - setupCustom(); await writeSync(page, '¥¥¥cafe\u0301 http://test:password@example.com/some_path'); await resetAndHover(12, 0); await evalLinkStateData('http://test:password@example.com/some_path', { start: { x: 12, y: 1 }, end: { x: 13, y: 2 } }); @@ -91,8 +94,6 @@ describe('WebLinksAddon', () => { }); async function testHostName(hostname: string): Promise { - await openTerminal(page, { cols: 40 }); - await page.evaluate(`window.term.loadAddon(new window.WebLinksAddon())`); const data = ` http://${hostname} \\r\\n` + ` http://${hostname}/a~b#c~d?e~f \\r\\n` + ` http://${hostname}/colon:test \\r\\n` + @@ -117,14 +118,6 @@ async function pollForLinkAtCell(col: number, row: number, value: string): Promi assert.deepEqual(text, value); } -async function setupCustom(): Promise { - await openTerminal(page, { cols: 40 }); - await page.evaluate(`window._linkStateData = {uri:''}; -window._linkaddon = new window.WebLinksAddon(); -window._linkaddon._options.hover = (event, uri, range) => { window._linkStateData = { uri, range }; }; -window.term.loadAddon(window._linkaddon);`); -} - async function resetAndHover(col: number, row: number): Promise { await page.mouse.move(0, 0); await page.evaluate(`window._linkStateData = {uri:''};`); From 243b0bb6265046e98314777678fc48d10a2793a0 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 19 Aug 2023 05:06:46 -0700 Subject: [PATCH 3/7] Add all country tlds to tests --- .../test/WebLinksAddon.api.ts | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts b/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts index d5864a9c..a086e1d3 100644 --- a/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts +++ b/addons/xterm-addon-web-links/test/WebLinksAddon.api.ts @@ -49,9 +49,34 @@ describe('WebLinksAddon', () => { `); }); - it('.com', async () => await testHostName('foo.com')); - it('.com.au', async () => await testHostName('foo.com.au')); - it('.io', async () => await testHostName('foo.io')); + const countryTlds = [ + '.ac', '.ad', '.ae', '.af', '.ag', '.ai', '.al', '.am', '.ao', '.aq', '.ar', '.as', '.at', + '.au', '.aw', '.ax', '.az', '.ba', '.bb', '.bd', '.be', '.bf', '.bg', '.bh', '.bi', '.bj', + '.bm', '.bn', '.bo', '.bq', '.br', '.bs', '.bt', '.bw', '.by', '.bz', '.ca', '.cc', '.cd', + '.cf', '.cg', '.ch', '.ci', '.ck', '.cl', '.cm', '.cn', '.co', '.cr', '.cu', '.cv', '.cw', + '.cx', '.cy', '.cz', '.de', '.dj', '.dk', '.dm', '.do', '.dz', '.ec', '.ee', '.eg', '.eh', + '.er', '.es', '.et', '.eu', '.fi', '.fj', '.fk', '.fm', '.fo', '.fr', '.ga', '.gd', '.ge', + '.gf', '.gg', '.gh', '.gi', '.gl', '.gm', '.gn', '.gp', '.gq', '.gr', '.gs', '.gt', '.gu', + '.gw', '.gy', '.hk', '.hm', '.hn', '.hr', '.ht', '.hu', '.id', '.ie', '.il', '.im', '.in', + '.io', '.iq', '.ir', '.is', '.it', '.je', '.jm', '.jo', '.jp', '.ke', '.kg', '.kh', '.ki', + '.km', '.kn', '.kp', '.kr', '.kw', '.ky', '.kz', '.la', '.lb', '.lc', '.li', '.lk', '.lr', + '.ls', '.lt', '.lu', '.lv', '.ly', '.ma', '.mc', '.md', '.me', '.mg', '.mh', '.mk', '.ml', + '.mm', '.mn', '.mo', '.mp', '.mq', '.mr', '.ms', '.mt', '.mu', '.mv', '.mw', '.mx', '.my', + '.mz', '.na', '.nc', '.ne', '.nf', '.ng', '.ni', '.nl', '.no', '.np', '.nr', '.nu', '.nz', + '.om', '.pa', '.pe', '.pf', '.pg', '.ph', '.pk', '.pl', '.pm', '.pn', '.pr', '.ps', '.pt', + '.pw', '.py', '.qa', '.re', '.ro', '.rs', '.ru', '.rw', '.sa', '.sb', '.sc', '.sd', '.se', + '.sg', '.sh', '.si', '.sk', '.sl', '.sm', '.sn', '.so', '.sr', '.ss', '.st', '.su', '.sv', + '.sx', '.sy', '.sz', '.tc', '.td', '.tf', '.tg', '.th', '.tj', '.tk', '.tl', '.tm', '.tn', + '.to', '.tr', '.tt', '.tv', '.tw', '.tz', '.ua', '.ug', '.uk', '.us', '.uy', '.uz', '.va', + '.vc', '.ve', '.vg', '.vi', '.vn', '.vu', '.wf', '.ws', '.ye', '.yt', '.za', '.zm', '.zw' + ]; + for (const tld of countryTlds) { + it(tld, async () => await testHostName(`foo${tld}`)); + } + it(`.com`, async () => await testHostName(`foo.com`)); + for (const tld of countryTlds) { + it(`.com${tld}`, async () => await testHostName(`foo.com${tld}`)); + } describe('correct buffer offsets & uri', () => { beforeEach(async () => { From f0900fdc5f5fea0688e5dfa1f143a0f332bd5809 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 19 Aug 2023 05:32:41 -0700 Subject: [PATCH 4/7] Tweak format of CSI test names to make it easier to see terminating char --- test/api/InputHandler.api.ts | 104 +++++++++++++++++------------------ 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/test/api/InputHandler.api.ts b/test/api/InputHandler.api.ts index d83fcb1f..4bc1ed3e 100644 --- a/test/api/InputHandler.api.ts +++ b/test/api/InputHandler.api.ts @@ -37,7 +37,7 @@ describe('InputHandler Integration Tests', function(): void { await page.evaluate(`window.term.reset()`); }); - it('ICH: Insert Ps (Blank) Character(s) (default = 1) - CSI Ps @', async function(): Promise { + it('CSI Ps @ - ICH: Insert Ps (Blank) Character(s) (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('foo\\x1b[3D\\x1b[@\\n\\r') @@ -47,7 +47,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' foo', ' bar']); }); - it('CUU: Cursor Up Ps Times (default = 1) - CSI Ps A', async function(): Promise { + it('CSI Ps A - CUU: Cursor Up Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Aa') @@ -57,7 +57,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', ' b', '', 'a']); }); - it('CUD: Cursor Down Ps Times (default = 1) - CSI Ps B', async function(): Promise { + it('CSI Ps B - CUD: Cursor Down Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ba') @@ -67,7 +67,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', ' b']); }); - it('CUF: Cursor Forward Ps Times (default = 1) - CSI Ps C', async function(): Promise { + it('CSI Ps C - CUF: Cursor Forward Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ca') @@ -77,7 +77,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), [' a b']); }); - it('CUB: Cursor Backward Ps Times (default = 1) - CSI Ps D', async function(): Promise { + it('CSI Ps D - CUB: Cursor Backward Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Da') @@ -87,7 +87,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['fba']); }); - it('CNL: Cursor Next Line Ps Times (default = 1) - CSI Ps E', async function(): Promise { + it('CSI Ps E - CNL: Cursor Next Line Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ea') @@ -97,7 +97,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', 'b']); }); - it('CPL: Cursor Preceding Line Ps Times (default = 1) - CSI Ps F', async function(): Promise { + it('CSI Ps F - CPL: Cursor Preceding Line Ps Times (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Fa') @@ -107,7 +107,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), ['', 'b', '', 'a', '']); }); - it('CHA: Cursor Character Absolute [column] (default = [row,1]) - CSI Ps G', async function(): Promise { + it('CSI Ps G - CHA: Cursor Character Absolute [column] (default = [row,1])', async function(): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Ga') @@ -117,7 +117,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['aoo b']); }); - it('CUP: Cursor Position [row;column] (default = [1,1]) - CSI Ps ; Ps H', async function(): Promise { + it('CSI Ps ; Ps H - CUP: Cursor Position [row;column] (default = [1,1])', async function(): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[Ha') @@ -127,7 +127,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(3), ['aoo', '', ' b']); }); - it('CHT: Cursor Forward Tabulation Ps tab stops (default = 1) - CSI Ps I', async function(): Promise { + it('CSI Ps I - CHT: Cursor Forward Tabulation Ps tab stops (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('\x1b[Ia') @@ -137,7 +137,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' a', ' b']); }); - it('ED: Erase in Display, VT100 - CSI Ps J', async function(): Promise { + it('CSI Ps J - ED: Erase in Display, VT100', async function(): Promise { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -166,7 +166,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('DECSED: Erase in Display, VT220 - CSI ? Ps J', async function(): Promise { + it('CSI ? Ps J - DECSED: Erase in Display, VT220', async function(): Promise { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -195,7 +195,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('IL: Insert Ps Line(s) (default = 1) - CSI Ps L', async function(): Promise { + it('CSI Ps L - IL: Insert Ps Line(s) (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('foo\x1b[La') @@ -205,7 +205,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['b', '', 'a', 'foo']); }); - it('DL: Delete Ps Line(s) (default = 1) - CSI Ps M', async function(): Promise { + it('CSI Ps M - DL: Delete Ps Line(s) (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('a\\nb\x1b[1F\x1b[M') @@ -215,7 +215,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' b', ' f', '', '', '']); }); - it('DCH: Delete Ps Character(s) (default = 1) - CSI Ps P', async function(): Promise { + it('CSI Ps P - DCH: Delete Ps Character(s) (default = 1)', async function(): Promise { await page.evaluate(` // Default window.term.write('abc\x1b[1;1H\x1b[P') @@ -225,7 +225,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), ['bc', 'f']); }); - describe('DSR: Device Status Report', () => { + describe('CSI Ps n - DSR: Device Status Report', () => { it('Status Report - CSI 5 n', async function(): Promise { await page.evaluate(` window.term.onData(e => window.result = e); @@ -259,45 +259,43 @@ describe('InputHandler Integration Tests', function(): void { }); }); - describe('SM: Set Mode', () => { - describe('CSI ? Pm h', () => { - it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async () => { - const coords: { left: number, top: number, bottom: number, right: number } = await page.evaluate(` - (function() { - const rect = window.term.element.getBoundingClientRect(); - return { left: rect.left, top: rect.top, bottom: rect.bottom, right: rect.right }; - })(); - `); - // Click and drag and ensure there is a selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await page.mouse.down(); - await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); - assert.ok(await page.evaluate(`window.term.getSelection().length`) as number > 0, 'mouse events are off so there should be a selection'); - await page.mouse.up(); - // Clear selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); - // Enable mouse events - await page.evaluate(`window.term.write('\x1b[?1003h')`); - // Click and drag and ensure there is no selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await page.mouse.down(); - await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); - // mouse events are on so there should be no selection - await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); - await page.mouse.up(); - }); - (isChromium ? it : it.skip)('Pm = 2004, Set bracketed paste mode', async function(): Promise { - await pollFor(page, () => simulatePaste('foo'), 'foo'); - await page.evaluate(`window.term.write('\x1b[?2004h')`); - await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); - await page.evaluate(`window.term.write('\x1b[?2004l')`); - await pollFor(page, () => simulatePaste('baz'), 'baz'); - }); + describe('CSI ? Pm h - DECSET: Private Mode Set', () => { + it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async () => { + const coords: { left: number, top: number, bottom: number, right: number } = await page.evaluate(` + (function() { + const rect = window.term.element.getBoundingClientRect(); + return { left: rect.left, top: rect.top, bottom: rect.bottom, right: rect.right }; + })(); + `); + // Click and drag and ensure there is a selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await page.mouse.down(); + await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); + assert.ok(await page.evaluate(`window.term.getSelection().length`) as number > 0, 'mouse events are off so there should be a selection'); + await page.mouse.up(); + // Clear selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); + // Enable mouse events + await page.evaluate(`window.term.write('\x1b[?1003h')`); + // Click and drag and ensure there is no selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await page.mouse.down(); + await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); + // mouse events are on so there should be no selection + await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); + await page.mouse.up(); + }); + (isChromium ? it : it.skip)('Pm = 2004, Set bracketed paste mode', async function(): Promise { + await pollFor(page, () => simulatePaste('foo'), 'foo'); + await page.evaluate(`window.term.write('\x1b[?2004h')`); + await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); + await page.evaluate(`window.term.write('\x1b[?2004l')`); + await pollFor(page, () => simulatePaste('baz'), 'baz'); }); }); - it('REP: Repeat preceding character, ECMA48 - CSI Ps b', async function(): Promise { + it('CSI Ps b - REP: Repeat preceding character, ECMA48', async function(): Promise { // default to 1 await page.evaluate(` window.term.resize(10, 10); @@ -347,7 +345,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(3), ['#', ' #', 'abcd####']); }); - describe('Window Options - CSI Ps ; Ps ; Ps t', () => { + describe('CSI Ps ; Ps ; Ps t - Window Options', () => { it('should be disabled by default', async function(): Promise { await page.evaluate(`(() => { window._stack = []; From 0867804504157353d992e208dbfc11dd41b79d43 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 19 Aug 2023 05:33:49 -0700 Subject: [PATCH 5/7] Prefer arrow function --- test/api/InputHandler.api.ts | 48 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/api/InputHandler.api.ts b/test/api/InputHandler.api.ts index 4bc1ed3e..fcba97f3 100644 --- a/test/api/InputHandler.api.ts +++ b/test/api/InputHandler.api.ts @@ -18,7 +18,7 @@ const height = 600; let isChromium = false; describe('InputHandler Integration Tests', function(): void { - before(async function(): Promise { + before(async () => { const browserType = getBrowserType(); isChromium = browserType.name() === 'chromium'; browser = await launchBrowser(); @@ -37,7 +37,7 @@ describe('InputHandler Integration Tests', function(): void { await page.evaluate(`window.term.reset()`); }); - it('CSI Ps @ - ICH: Insert Ps (Blank) Character(s) (default = 1)', async function(): Promise { + it('CSI Ps @ - ICH: Insert Ps (Blank) Character(s) (default = 1)', async () => { await page.evaluate(` // Default window.term.write('foo\\x1b[3D\\x1b[@\\n\\r') @@ -47,7 +47,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' foo', ' bar']); }); - it('CSI Ps A - CUU: Cursor Up Ps Times (default = 1)', async function(): Promise { + it('CSI Ps A - CUU: Cursor Up Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Aa') @@ -57,7 +57,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', ' b', '', 'a']); }); - it('CSI Ps B - CUD: Cursor Down Ps Times (default = 1)', async function(): Promise { + it('CSI Ps B - CUD: Cursor Down Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\x1b[Ba') @@ -67,7 +67,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', ' b']); }); - it('CSI Ps C - CUF: Cursor Forward Ps Times (default = 1)', async function(): Promise { + it('CSI Ps C - CUF: Cursor Forward Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\x1b[Ca') @@ -77,7 +77,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), [' a b']); }); - it('CSI Ps D - CUB: Cursor Backward Ps Times (default = 1)', async function(): Promise { + it('CSI Ps D - CUB: Cursor Backward Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('foo\x1b[Da') @@ -87,7 +87,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['fba']); }); - it('CSI Ps E - CNL: Cursor Next Line Ps Times (default = 1)', async function(): Promise { + it('CSI Ps E - CNL: Cursor Next Line Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\x1b[Ea') @@ -97,7 +97,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', 'b']); }); - it('CSI Ps F - CPL: Cursor Preceding Line Ps Times (default = 1)', async function(): Promise { + it('CSI Ps F - CPL: Cursor Preceding Line Ps Times (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\\n\\n\\n\\n\x1b[Fa') @@ -107,7 +107,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), ['', 'b', '', 'a', '']); }); - it('CSI Ps G - CHA: Cursor Character Absolute [column] (default = [row,1])', async function(): Promise { + it('CSI Ps G - CHA: Cursor Character Absolute [column] (default = [row,1])', async () => { await page.evaluate(` // Default window.term.write('foo\x1b[Ga') @@ -117,7 +117,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(1), ['aoo b']); }); - it('CSI Ps ; Ps H - CUP: Cursor Position [row;column] (default = [1,1])', async function(): Promise { + it('CSI Ps ; Ps H - CUP: Cursor Position [row;column] (default = [1,1])', async () => { await page.evaluate(` // Default window.term.write('foo\x1b[Ha') @@ -127,7 +127,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(3), ['aoo', '', ' b']); }); - it('CSI Ps I - CHT: Cursor Forward Tabulation Ps tab stops (default = 1)', async function(): Promise { + it('CSI Ps I - CHT: Cursor Forward Tabulation Ps tab stops (default = 1)', async () => { await page.evaluate(` // Default window.term.write('\x1b[Ia') @@ -137,7 +137,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(2), [' a', ' b']); }); - it('CSI Ps J - ED: Erase in Display, VT100', async function(): Promise { + it('CSI Ps J - ED: Erase in Display, VT100', async () => { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -166,7 +166,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('CSI ? Ps J - DECSED: Erase in Display, VT220', async function(): Promise { + it('CSI ? Ps J - DECSED: Erase in Display, VT220', async () => { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` // Default: Erase Below @@ -195,7 +195,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('CSI Ps L - IL: Insert Ps Line(s) (default = 1)', async function(): Promise { + it('CSI Ps L - IL: Insert Ps Line(s) (default = 1)', async () => { await page.evaluate(` // Default window.term.write('foo\x1b[La') @@ -205,7 +205,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(4), ['b', '', 'a', 'foo']); }); - it('CSI Ps M - DL: Delete Ps Line(s) (default = 1)', async function(): Promise { + it('CSI Ps M - DL: Delete Ps Line(s) (default = 1)', async () => { await page.evaluate(` // Default window.term.write('a\\nb\x1b[1F\x1b[M') @@ -215,7 +215,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => getLinesAsArray(5), [' b', ' f', '', '', '']); }); - it('CSI Ps P - DCH: Delete Ps Character(s) (default = 1)', async function(): Promise { + it('CSI Ps P - DCH: Delete Ps Character(s) (default = 1)', async () => { await page.evaluate(` // Default window.term.write('abc\x1b[1;1H\x1b[P') @@ -226,7 +226,7 @@ describe('InputHandler Integration Tests', function(): void { }); describe('CSI Ps n - DSR: Device Status Report', () => { - it('Status Report - CSI 5 n', async function(): Promise { + it('Status Report - CSI 5 n', async () => { await page.evaluate(` window.term.onData(e => window.result = e); window.term.write('\\x1b[5n'); @@ -234,7 +234,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.result`), '\x1b[0n'); }); - it('Report Cursor Position (CPR) - CSI 6 n', async function(): Promise { + it('Report Cursor Position (CPR) - CSI 6 n', async () => { await page.evaluate(`window.term.write('\\n\\nfoo')`); await pollFor(page, () => page.evaluate(` [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] @@ -246,7 +246,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.result`), '\x1b[3;4R'); }); - it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async function(): Promise { + it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async () => { await page.evaluate(`window.term.write('\\n\\nfoo')`); await pollFor(page, () => page.evaluate(` [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] @@ -286,7 +286,7 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); await page.mouse.up(); }); - (isChromium ? it : it.skip)('Pm = 2004, Set bracketed paste mode', async function(): Promise { + (isChromium ? it : it.skip)('Pm = 2004, Set bracketed paste mode', async () => { await pollFor(page, () => simulatePaste('foo'), 'foo'); await page.evaluate(`window.term.write('\x1b[?2004h')`); await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); @@ -295,7 +295,7 @@ describe('InputHandler Integration Tests', function(): void { }); }); - it('CSI Ps b - REP: Repeat preceding character, ECMA48', async function(): Promise { + it('CSI Ps b - REP: Repeat preceding character, ECMA48', async () => { // default to 1 await page.evaluate(` window.term.resize(10, 10); @@ -346,7 +346,7 @@ describe('InputHandler Integration Tests', function(): void { }); describe('CSI Ps ; Ps ; Ps t - Window Options', () => { - it('should be disabled by default', async function(): Promise { + it('should be disabled by default', async () => { await page.evaluate(`(() => { window._stack = []; const _h = window.term.onData(data => window._stack.push(data)); @@ -359,7 +359,7 @@ describe('InputHandler Integration Tests', function(): void { })()`); await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), []); }); - it('14 - GetWinSizePixels', async function(): Promise { + it('14 - GetWinSizePixels', async () => { await page.evaluate(`window.term.options.windowOptions = { getWinSizePixels: true }; `); await page.evaluate(`(() => { window._stack = []; @@ -370,7 +370,7 @@ describe('InputHandler Integration Tests', function(): void { const d = await getDimensions(); await pollFor(page, async () => await page.evaluate(`(() => _stack)()`), [`\x1b[4;${d.height};${d.width}t`]); }); - it('16 - GetCellSizePixels', async function(): Promise { + it('16 - GetCellSizePixels', async () => { await page.evaluate(`window.term.options.windowOptions = { getCellSizePixels: true }; `); await page.evaluate(`(() => { window._stack = []; From 8fad65d1d5932cb773f6c1f6949b40074360b572 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 19 Aug 2023 06:11:01 -0700 Subject: [PATCH 6/7] Stub out all CSI tests Part of #2117 --- test/api/InputHandler.api.ts | 986 ++++++++++++++++++++++++++++++++--- 1 file changed, 903 insertions(+), 83 deletions(-) diff --git a/test/api/InputHandler.api.ts b/test/api/InputHandler.api.ts index fcba97f3..c894a4d8 100644 --- a/test/api/InputHandler.api.ts +++ b/test/api/InputHandler.api.ts @@ -46,7 +46,9 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(2), [' foo', ' bar']); }); - + it.skip('CSI Ps SP @ - SL: Shift left Ps columns(s) (default = 1), ECMA-48', async () => { + // TODO: Implement + }); it('CSI Ps A - CUU: Cursor Up Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -56,7 +58,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(4), ['', ' b', '', 'a']); }); - it('CSI Ps B - CUD: Cursor Down Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -66,7 +67,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', ' b']); }); - it('CSI Ps C - CUF: Cursor Forward Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -76,7 +76,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(1), [' a b']); }); - it('CSI Ps D - CUB: Cursor Backward Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -86,7 +85,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(1), ['fba']); }); - it('CSI Ps E - CNL: Cursor Next Line Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -96,7 +94,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(4), ['', 'a', '', 'b']); }); - it('CSI Ps F - CPL: Cursor Preceding Line Ps Times (default = 1)', async () => { await page.evaluate(` // Default @@ -106,7 +103,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(5), ['', 'b', '', 'a', '']); }); - it('CSI Ps G - CHA: Cursor Character Absolute [column] (default = [row,1])', async () => { await page.evaluate(` // Default @@ -116,7 +112,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(1), ['aoo b']); }); - it('CSI Ps ; Ps H - CUP: Cursor Position [row;column] (default = [1,1])', async () => { await page.evaluate(` // Default @@ -126,7 +121,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(3), ['aoo', '', ' b']); }); - it('CSI Ps I - CHT: Cursor Forward Tabulation Ps tab stops (default = 1)', async () => { await page.evaluate(` // Default @@ -136,7 +130,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(2), [' a', ' b']); }); - it('CSI Ps J - ED: Erase in Display, VT100', async () => { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` @@ -165,7 +158,6 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.term.buffer.active.length`), 5); await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - it('CSI ? Ps J - DECSED: Erase in Display, VT220', async () => { const fixture = 'abc\\n\\rdef\\n\\rghi\x1b[2;2H'; await page.evaluate(` @@ -194,7 +186,12 @@ describe('InputHandler Integration Tests', function(): void { await pollFor(page, () => page.evaluate(`window.term.buffer.active.length`), 5); await pollFor(page, () => getLinesAsArray(5), [' 4', ' 5', 'abc', 'def', 'ghi']); }); - + it.skip('CSI Ps K - EL: Erase in Line, VT100', async () => { + // TODO: Implement + }); + it.skip('CSI ? Ps K - DECSEL: Erase in Line, VT220', async () => { + // TODO: Implement + }); it('CSI Ps L - IL: Insert Ps Line(s) (default = 1)', async () => { await page.evaluate(` // Default @@ -204,7 +201,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(4), ['b', '', 'a', 'foo']); }); - it('CSI Ps M - DL: Delete Ps Line(s) (default = 1)', async () => { await page.evaluate(` // Default @@ -214,7 +210,6 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(5), [' b', ' f', '', '', '']); }); - it('CSI Ps P - DCH: Delete Ps Character(s) (default = 1)', async () => { await page.evaluate(` // Default @@ -224,77 +219,45 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(2), ['bc', 'f']); }); - - describe('CSI Ps n - DSR: Device Status Report', () => { - it('Status Report - CSI 5 n', async () => { - await page.evaluate(` - window.term.onData(e => window.result = e); - window.term.write('\\x1b[5n'); - `); - await pollFor(page, () => page.evaluate(`window.result`), '\x1b[0n'); - }); - - it('Report Cursor Position (CPR) - CSI 6 n', async () => { - await page.evaluate(`window.term.write('\\n\\nfoo')`); - await pollFor(page, () => page.evaluate(` - [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] - `), [2, 3]); - await page.evaluate(` - window.term.onData(e => window.result = e); - window.term.write('\\x1b[6n'); - `); - await pollFor(page, () => page.evaluate(`window.result`), '\x1b[3;4R'); - }); - - it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async () => { - await page.evaluate(`window.term.write('\\n\\nfoo')`); - await pollFor(page, () => page.evaluate(` - [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] - `), [2, 3]); - await page.evaluate(` - window.term.onData(e => window.result = e); - window.term.write('\\x1b[?6n'); - `); - await pollFor(page, () => page.evaluate(`window.result`), '\x1b[?3;4R'); - }); + it.skip('CSI Pm # P - XTPUSHCOLORS: Push current dynamic- and ANSI-palette colors onto stack, xterm', async () => { + // TODO: Implement }); - - describe('CSI ? Pm h - DECSET: Private Mode Set', () => { - it('Pm = 1003, Set Use All Motion (any event) Mouse Tracking', async () => { - const coords: { left: number, top: number, bottom: number, right: number } = await page.evaluate(` - (function() { - const rect = window.term.element.getBoundingClientRect(); - return { left: rect.left, top: rect.top, bottom: rect.bottom, right: rect.right }; - })(); - `); - // Click and drag and ensure there is a selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await page.mouse.down(); - await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); - assert.ok(await page.evaluate(`window.term.getSelection().length`) as number > 0, 'mouse events are off so there should be a selection'); - await page.mouse.up(); - // Clear selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); - // Enable mouse events - await page.evaluate(`window.term.write('\x1b[?1003h')`); - // Click and drag and ensure there is no selection - await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); - await page.mouse.down(); - await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); - // mouse events are on so there should be no selection - await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); - await page.mouse.up(); - }); - (isChromium ? it : it.skip)('Pm = 2004, Set bracketed paste mode', async () => { - await pollFor(page, () => simulatePaste('foo'), 'foo'); - await page.evaluate(`window.term.write('\x1b[?2004h')`); - await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); - await page.evaluate(`window.term.write('\x1b[?2004l')`); - await pollFor(page, () => simulatePaste('baz'), 'baz'); - }); + it.skip('CSI Pm # Q - XTPOPCOLORS: Pop stack to set dynamic- and ANSI-palette colors, xterm', async () => { + // TODO: Implement + }); + it.skip('CSI # R - XTREPORTCOLORS: Report the current entry on the palette stack, and the number of palettes stored on the stack, using the same form as XTPOPCOLOR (default = 0), xterm', async () => { + // TODO: Implement + }); + it.skip('CSI Ps S - SU: Scroll up Ps lines (default = 1), VT420, ECMA-48', async () => { + // TODO: Implement + }); + it.skip('CSI ? Pi ; Pa ; Pv S - XTSMGRAPHICS: Set or request graphics attribute, xterm', async () => { + // TODO: Implement + }); + it.skip('CSI Ps T - SD: Scroll down Ps lines (default = 1), VT420', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ; Ps ; Ps ; Ps ; Ps T - XTHIMOUSE: Initiate highlight mouse tracking (XTHIMOUSE), xterm', async () => { + // TODO: Implement + }); + it.skip('CSI > Pm T - XTRMTITLE: Reset title mode features to default value, xterm', async () => { + // TODO: Implement + }); + it.skip('CSI Ps X - ECH: Erase Ps Character(s) (default = 1)', async () => { + // TODO: Implement + }); + it.skip('CSI Ps Z - CBT: Cursor Backward Tabulation Ps tab stops (default = 1)', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ^ - SD: Scroll down Ps lines (default = 1) (SD), ECMA-48', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ` - HPA: Character Position Absolute [column] (default = [row,1])', async () => { + // TODO: Implement + }); + it.skip('CSI Ps a - ', async () => { + // TODO: Implement }); - it('CSI Ps b - REP: Repeat preceding character, ECMA48', async () => { // default to 1 await page.evaluate(` @@ -344,7 +307,864 @@ describe('InputHandler Integration Tests', function(): void { `); await pollFor(page, () => getLinesAsArray(3), ['#', ' #', 'abcd####']); }); + it.skip('CSI Ps c - ', async () => { + // TODO: Implement + }); + it.skip('CSI = Ps c - ', async () => { + // TODO: Implement + }); + it.skip('CSI > Ps c - ', async () => { + // TODO: Implement + }); + it.skip('CSI Ps d - ', async () => { + // TODO: Implement + }); + it.skip('CSI Ps e - ', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ; Ps f - ', async () => { + // TODO: Implement + }); + it.skip('CSI Ps g - ', async () => { + // TODO: Implement + }); + it.skip('CSI Ps h - ', async () => { + // TODO: Implement + }); + describe('CSI ? Pm h - DECSET: Private Mode Set', () => { + it.skip('Ps = 1 - Application Cursor Keys (DECCKM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 - Designate USASCII for character sets G0-G3 (DECANM), VT100, and set VT100 mode', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 - 132 Column Mode (DECCOLM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 - Smooth (Slow) Scroll (DECSCLM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 5 - Reverse Video (DECSCNM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 - Origin Mode (DECOM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 7 - Auto-Wrap Mode (DECAWM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 8 - Auto-Repeat Keys (DECARM), VT100', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 - Send Mouse X & Y on button press', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 - Show toolbar (rxvt)', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 2 - Start blinking cursor (AT&T 610)', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 3 - Start blinking cursor (set only via resource or menu)', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 4 - Enable XOR of blinking cursor control sequence and menu', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 8 - Print Form Feed (DECPFF), VT220', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 9 - Set print extent to full screen (DECPEX), VT220', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 5 - Show cursor (DECTCEM), VT220', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 0 - Show scrollbar (rxvt)', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 5 - Enable font-shifting functions (rxvt)', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 8 - Enter Tektronix mode (DECTEK), VT240, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 0 - Allow 80 ⇒ 132 mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 1 - more(1) fix (see curses resource)', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 2 - Enable National Replacement Character sets (DECNRCM), VT220', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 3 - Enable Graphic Expanded Print Mode (DECGEPM), VT340', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 4 - Turn on margin bell, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 4 - Enable Graphic Print Color Mode (DECGPCM), VT340', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 5 - Reverse-wraparound mode (XTREVWRAP), xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 5 - Enable Graphic Print Color Syntax (DECGPCS), VT340', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 6 - Start logging (XTLOGGING), xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 6 - Graphic Print Background Mode, VT340', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 7 - Use Alternate Screen Buffer, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 7 - Enable Graphic Rotated Print Mode (DECGRPM), VT340', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 6 - Application keypad mode (DECNKM), VT320', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 7 - Backarrow key sends backspace (DECBKM), VT340, VT420', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 9 - Enable left and right margin mode (DECLRMM), VT420 and up', async () => { + // TODO: Implement + }); + it.skip('Ps = 8 0 - Enable Sixel Display Mode (DECSDM), VT330, VT340, VT382', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 5 - Do not clear screen when DECCOLM is set/reset (DECNCSM), VT510 and up', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 0 - Send Mouse X & Y on button press and release', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 1 - Use Hilite Mouse Tracking, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 2 - Use Cell Motion Mouse Tracking, xterm', async () => { + // TODO: Implement + }); + it('Ps = 1 0 0 3 - Set Use All Motion (any event) Mouse Tracking', async () => { + const coords: { left: number, top: number, bottom: number, right: number } = await page.evaluate(` + (function() { + const rect = window.term.element.getBoundingClientRect(); + return { left: rect.left, top: rect.top, bottom: rect.bottom, right: rect.right }; + })(); + `); + // Click and drag and ensure there is a selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await page.mouse.down(); + await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); + assert.ok(await page.evaluate(`window.term.getSelection().length`) as number > 0, 'mouse events are off so there should be a selection'); + await page.mouse.up(); + // Clear selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); + // Enable mouse events + await page.evaluate(`window.term.write('\x1b[?1003h')`); + // Click and drag and ensure there is no selection + await page.mouse.click((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 2); + await page.mouse.down(); + await page.mouse.move((coords.left + coords.right) / 2, (coords.top + coords.bottom) / 4); + // mouse events are on so there should be no selection + await pollFor(page, () => page.evaluate(`window.term.getSelection().length`), 0); + await page.mouse.up(); + }); + it.skip('Ps = 1 0 0 4 - Send FocusIn/FocusOut events, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 5 - Enable UTF-8 Mouse Mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 6 - Enable SGR Mouse Mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 7 - Enable Alternate Scroll Mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 0 - Scroll to bottom on tty output (rxvt)', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 1 - Scroll to bottom on key press (rxvt)', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 5 - Enable urxvt Mouse Mode', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 6 - Enable SGR Mouse PixelMode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 4 - Interpret "meta" key, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 5 - Enable special modifiers for Alt and NumLock keys, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 6 - Send ESC when Meta modifies a key, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 7 - Send DEL from the editing-keypad Delete key, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 9 - Send ESC when Alt modifies a key, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 0 - Keep selection even if not highlighted, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 1 - Use the CLIPBOARD selection, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 2 - Enable Urgency window manager hint when Control-G is received, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 3 - Enable raising of the window when Control-G is received, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 4 - Reuse the most recent data copied to CLIPBOARD, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 5 - XTREVWRAP2: Extended Reverse-wraparound mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 6 - Enable switching to/from Alternate Screen Buffer, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 7 - Use Alternate Screen Buffer, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 8 - Save cursor as in DECSC, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 9 - Save cursor as in DECSC, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 0 - Set terminfo/termcap function-key mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 1 - Set Sun function-key mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 2 - Set HP function-key mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 3 - Set SCO function-key mode, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 6 0 - Set legacy keyboard emulation, i.e, X11R6, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 6 1 - Set VT220 keyboard emulation, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 1 - Enable readline mouse button-1, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 2 - Enable readline mouse button-2, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 3 - Enable readline mouse button-3, xterm', async () => { + // TODO: Implement + }); + (isChromium ? it : it.skip)('Pm = 2 0 0 4, Set bracketed paste mode', async () => { + await pollFor(page, () => simulatePaste('foo'), 'foo'); + await page.evaluate(`window.term.write('\x1b[?2004h')`); + await pollFor(page, () => simulatePaste('bar'), '\x1b[200~bar\x1b[201~'); + await page.evaluate(`window.term.write('\x1b[?2004l')`); + await pollFor(page, () => simulatePaste('baz'), 'baz'); + }); + it.skip('Ps = 2 0 0 5 - Enable readline character-quoting, xterm', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 6 - Enable readline newline pasting, xterm', async () => { + // TODO: Implement + }); + }); + it.skip('CSI Ps i - MC: Media Copy', async () => { + // TODO: Implement + }); + it.skip('CSI ? Ps i - MC: Media Copy, DEC-specified', async () => { + // TODO: Implement + }); + it.skip('CSI Pm l - RM: Reset Mode', async () => { + // TODO: Implement + }); + describe('CSI ? Pm l - DECRST: DEC Private Mode Reset', async () => { + it.skip('Ps = 1 - Normal Cursor Keys (DECCKM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 - Designate VT52 mode (DECANM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 - 80 Column Mode (DECCOLM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 - Jump (Fast) Scroll (DECSCLM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 5 - Normal Video (DECSCNM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 - Normal Cursor Mode (DECOM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 7 - No Auto-Wrap Mode (DECAWM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 8 - No Auto-Repeat Keys (DECARM), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 - Don\'t send Mouse X & Y on button press, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 - Hide toolbar (rxvt).', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 2 - Stop blinking cursor (AT&T 610).', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 3 - Disable blinking cursor (reset only via resource or menu).', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 4 - Disable XOR of blinking cursor control sequence and menu.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 8 - Don\'t Print Form Feed (DECPFF), VT220.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 9 - Limit print to scrolling region (DECPEX), VT220.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 5 - Hide cursor (DECTCEM), VT220.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 0 - Don\'t show scrollbar (rxvt).', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 5 - Disable font-shifting functions (rxvt).', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 0 - Disallow 80 ⇒ 132 mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 1 - No more(1) fix (see curses resource).', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 2 - Disable National Replacement Character sets (DECNRCM), VT220.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 3 - Disable Graphic Expanded Print Mode (DECGEPM), VT340.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 4 - Turn off margin bell, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 4 - Disable Graphic Print Color Mode (DECGPCM), VT340.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 5 - No Reverse-wraparound mode (XTREVWRAP), xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 5 - Disable Graphic Print Color Syntax (DECGPCS), VT340.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 6 - Stop logging (XTLOGGING), xterm. This is normally disabled by a compile-time option.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 7 - Use Normal Screen Buffer, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 7 - Disable Graphic Rotated Print Mode (DECGRPM), VT340.', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 6 - Numeric keypad mode (DECNKM), VT320.', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 7 - Backarrow key sends delete (DECBKM), VT340, VT420. This sets the backarrowKey resource to "false".', async () => { + // TODO: Implement + }); + it.skip('Ps = 6 9 - Disable left and right margin mode (DECLRMM), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('Ps = 8 0 - Disable Sixel Display Mode (DECSDM), VT330, VT340, VT382. Turns on "Sixel Scrolling". See the section Sixel Graphics and mode 8 4 5 2 .', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 5 - Clear screen when DECCOLM is set/reset (DECNCSM), VT510 and up.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 0 - Don\'t send Mouse X & Y on button press and release. See the section Mouse Tracking.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 1 - Don\'t use Hilite Mouse Tracking, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 2 - Don\'t use Cell Motion Mouse Tracking, xterm. See the section Button-event tracking.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 3 - Don\'t use All Motion Mouse Tracking, xterm. See the section Any-event tracking.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 4 - Don\'t send FocusIn/FocusOut events, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 5 - Disable UTF-8 Mouse Mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 6 - Disable SGR Mouse Mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 7 - Disable Alternate Scroll Mode, xterm. This corresponds to the alternateScroll resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 0 - Don\'t scroll to bottom on tty output (rxvt). This sets the scrollTtyOutput resource to "false".', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 1 - Don\'t scroll to bottom on key press (rxvt). This sets the scrollKey resource to "false".', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 5 - Disable urxvt Mouse Mode.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 6 - Disable SGR Mouse Pixel-Mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 4 - Don\'t interpret "meta" key, xterm. This disables the eightBitInput resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 5 - Disable special modifiers for Alt and NumLock keys, xterm. This disables the numLock resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 6 - Don\'t send ESC when Meta modifies a key, xterm. This disables the metaSendsEscape resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 7 - Send VT220 Remove from the editing-keypad Delete key, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 9 - Don\'t send ESC when Alt modifies a key, xterm. This disables the altSendsEscape resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 0 - Do not keep selection when not highlighted, xterm. This disables the keepSelection resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 1 - Use the PRIMARY selection, xterm. This disables the selectToClipboard resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 2 - Disable Urgency window manager hint when Control-G is received, xterm. This disables the bellIsUrgent resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 3 - Disable raising of the window when Control- G is received, xterm. This disables the popOnBell resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 5 - No Extended Reverse-wraparound mode (XTREVWRAP2), xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 6 - Disable switching to/from Alternate Screen Buffer, xterm. This works for terminfo-based systems, updating the titeInhibit resource. If currently using the Alternate Screen Buffer, xterm switches to the Normal Screen Buffer.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 7 - Use Normal Screen Buffer, xterm. Clear the screen first if in the Alternate Screen Buffer. This may be disabled by the titeInhibit resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 8 - Restore cursor as in DECRC, xterm. This may be disabled by the titeInhibit resource.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 9 - Use Normal Screen Buffer and restore cursor as in DECRC, xterm. This may be disabled by the titeInhibit resource. This combines the effects of the 1 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based applications rather than the 4 7 mode.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 0 - Reset terminfo/termcap function-key mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 1 - Reset Sun function-key mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 2 - Reset HP function-key mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 3 - Reset SCO function-key mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 6 0 - Reset legacy keyboard emulation, i.e, X11R6, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 6 1 - Reset keyboard emulation to Sun/PC style, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 1 - Disable readline mouse button-1, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 2 - Disable readline mouse button-2, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 3 - Disable readline mouse button-3, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 4 - Reset bracketed paste mode, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 5 - Disable readline character-quoting, xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 0 0 6 - Disable readline newline pasting, xterm.', async () => { + // TODO: Implement + }); + }); + describe('CSI Pm m - SGR: Character Attributes', () => { + it.skip('Ps = 0 - Normal (default), VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 - Bold, VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 - Faint, decreased intensity, ECMA-48 2nd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 - Italicized, ECMA-48 2nd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 - Underlined, VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 5 - Blink, VT100. This appears as Bold in X11R6 xterm.', async () => { + // TODO: Implement + }); + it.skip('Ps = 7 - Inverse, VT100.', async () => { + // TODO: Implement + }); + it.skip('Ps = 8 - Invisible, i.e., hidden, ECMA-48 2nd, VT300.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 - Crossed-out characters, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 1 - Doubly-underlined, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 2 - Normal (neither bold nor faint), ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 3 - Not italicized, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 4 - Not underlined, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 5 - Steady (not blinking), ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 7 - Positive (not inverse), ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 8 - Visible, i.e., not hidden, ECMA-48 3rd, VT300.', async () => { + // TODO: Implement + }); + it.skip('Ps = 2 9 - Not crossed-out, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 0 - Set foreground color to Black.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 1 - Set foreground color to Red.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 2 - Set foreground color to Green.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 3 - Set foreground color to Yellow.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 4 - Set foreground color to Blue.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 5 - Set foreground color to Magenta.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 6 - Set foreground color to Cyan.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 7 - Set foreground color to White.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 9 - Set foreground color to default, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 0 - Set background color to Black.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 1 - Set background color to Red.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 2 - Set background color to Green.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 3 - Set background color to Yellow.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 4 - Set background color to Blue.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 5 - Set background color to Magenta.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 6 - Set background color to Cyan.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 7 - Set background color to White.', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 9 - Set background color to default, ECMA-48 3rd.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 0 - Set foreground color to Black.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 1 - Set foreground color to Red.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 2 - Set foreground color to Green.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 3 - Set foreground color to Yellow.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 4 - Set foreground color to Blue.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 5 - Set foreground color to Magenta.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 6 - Set foreground color to Cyan.', async () => { + // TODO: Implement + }); + it.skip('Ps = 9 7 - Set foreground color to White.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 0 - Set background color to Black.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 1 - Set background color to Red.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 2 - Set background color to Green.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 3 - Set background color to Yellow.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 4 - Set background color to Blue.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 5 - Set background color to Magenta.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 6 - Set background color to Cyan.', async () => { + // TODO: Implement + }); + it.skip('Ps = 1 0 7 - Set background color to White.', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 8 : 2 : Pi : Pr : Pg : Pb- Set foreground color using RGB values', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 8 : 5 : Ps- Set foreground color to Ps, using indexed color', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 8 : 2 : Pi : Pr : Pg : Pb- Set background color using RGB values', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 8 : 5 : Ps- Set background color to Ps, using indexed color', async () => { + // TODO: Implement + }); + it.skip('Ps = 3 8 ; 2 ; Pr ; Pg ; Pb- Set foreground color using RGB values', async () => { + // TODO: Implement + }); + it.skip('Ps = 4 8 ; 2 ; Pr ; Pg ; Pb- Set background color using RGB values', async () => { + // TODO: Implement + }); + }); + it.skip('CSI > Pp [; Pv] m - XTMODKEYS: Set/reset key modifier options, xterm', () => { + // TODO: Implement + }); + it.skip('CSI ? Pp m - XTQMODKEYS: Query key modifier options, xterm', () => { + // TODO: Implement + }); + describe('CSI Ps n - DSR: Device Status Report', () => { + it('Status Report - CSI 5 n', async () => { + await page.evaluate(` + window.term.onData(e => window.result = e); + window.term.write('\\x1b[5n'); + `); + await pollFor(page, () => page.evaluate(`window.result`), '\x1b[0n'); + }); + it('Report Cursor Position (CPR) - CSI 6 n', async () => { + await page.evaluate(`window.term.write('\\n\\nfoo')`); + await pollFor(page, () => page.evaluate(` + [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] + `), [2, 3]); + await page.evaluate(` + window.term.onData(e => window.result = e); + window.term.write('\\x1b[6n'); + `); + await pollFor(page, () => page.evaluate(`window.result`), '\x1b[3;4R'); + }); + + it('Report Cursor Position (DECXCPR) - CSI ? 6 n', async () => { + await page.evaluate(`window.term.write('\\n\\nfoo')`); + await pollFor(page, () => page.evaluate(` + [window.term.buffer.active.cursorY, window.term.buffer.active.cursorX] + `), [2, 3]); + await page.evaluate(` + window.term.onData(e => window.result = e); + window.term.write('\\x1b[?6n'); + `); + await pollFor(page, () => page.evaluate(`window.result`), '\x1b[?3;4R'); + }); + }); + it.skip('CSI > Ps n - Disable key modifier options, xterm', () => { + // TODO: Implement + }); + describe.skip('CSI ? Ps n - DSR: Device Status Report (DEC-specific).', () => { + // TODO: Implement + }); + it.skip('CSI > Ps p - XTSMPOINTER: Set resource value pointerMode, xterm', () => { + // TODO: Implement + }); + it.skip('CSI ! p - DECSTR: Soft terminal reset, VT220 and up.', () => { + // TODO: Implement + }); + it.skip('CSI Pl ; Pc " p - DECSCL: Set conformance level, VT220 and up.', () => { + // TODO: Implement + }); + it.skip('CSI Ps $ p - DECRQM: Request ANSI mode', () => { + // TODO: Implement + }); + it.skip('CSI ? Ps $ p - Request DEC private mode (DECRQM).', () => { + // TODO: Implement + }); + it.skip('CSI [Pm] # p - Push video attributes onto stack (XTPUSHSGR), xterm. This is an alias for CSI # { , used to work around language limitations of C#.', async () => { + // TODO: Implement + }); + it.skip('CSI > Ps q - Report xterm name and version (XTVERSION).', async () => { + // TODO: Implement + }); + it.skip('CSI Ps q - Load LEDs (DECLL), VT100.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps SP q - Set cursor style (DECSCUSR), VT520.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps " q - Select character protection attribute (DECSCA), VT220.', async () => { + // TODO: Implement + }); + it.skip('CSI # q - Pop video attributes from stack (XTPOPSGR), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ; Ps r - Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM), VT100.', async () => { + // TODO: Implement + }); + it.skip('CSI ? Pm r - Restore DEC Private Mode Values (XTRESTORE), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr ; Pm $ r - Change Attributes in Rectangular Area (DECCARA), VT400 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI s - Save cursor, available only when DECLRMM is disabled (SCOSC, also ANSI.SYS).', async () => { + // TODO: Implement + }); + it.skip('CSI Pl ; Pr s - Set left and right margins (DECSLRM), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI > Ps s - Set/reset shift-escape options (XTSHIFTESCAPE), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI ? Pm s - Save DEC Private Mode Values (XTSAVE), xterm. Ps values are the same as for DECSET.', async () => { + // TODO: Implement + }); + it.skip('CSI > Pm t - This xterm control sets one or more features of the title modes (XTSMTITLE), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps SP t - Set warning-bell volume (DECSWBV), VT520.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr ; Pm $ t - Reverse Attributes in Rectangular Area (DECRARA), VT400 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI u - Restore cursor (SCORC, also ANSI.SYS).', async () => { + // TODO: Implement + }); + it.skip('CSI Ps SP u - Set margin-bell volume (DECSMBV), VT520.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr ; Pp ; Pt ; Pl ; Pp $ v - Copy Rectangular Area (DECCRA), VT400 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps $ w - Request presentation state report (DECRQPSR), VT320 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr \' w - Enable Filter Rectangle (DECEFR), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps x - Request Terminal Parameters (DECREQTPARM).', async () => { + // TODO: Implement + }); + it.skip('CSI Ps * x - Select Attribute Change Extent (DECSACE), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Pc ; Pt ; Pl ; Pb ; Pr $ x - Fill Rectangular Area (DECFRA), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps # y - Select checksum extension (XTCHECKSUM), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Pi ; Pg ; Pt ; Pl ; Pb ; Pr * y - Request Checksum of Rectangular Area (DECRQCRA), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps ; Pu \' z - Enable Locator Reporting (DECELR).', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr $ z - Erase Rectangular Area (DECERA), VT400 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Pm \' { - Select Locator Events (DECSLE).', async () => { + // TODO: Implement + }); + it.skip('CSI [Pm] # { Push video attributes onto stack (XTPUSHSGR), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr $ { - Selective Erase Rectangular Area (DECSERA), VT400 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Pt ; Pl ; Pb ; Pr # | - Report selected graphic rendition (XTREPORTSGR), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps $ | - Select columns per page (DECSCPP), VT340.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps \' | - Request Locator Position (DECRQLP).', async () => { + // TODO: Implement + }); + it.skip('CSI Ps * | - Select number of lines per screen (DECSNLS), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI # } - Pop video attributes from stack (XTPOPSGR), xterm.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps \' } - Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps $ } - Select active status display (DECSASD), VT320 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps \' ~ - Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.', async () => { + // TODO: Implement + }); + it.skip('CSI Ps $ ~ - Select status line type (DECSSDT), VT320 and up.', async () => { + // TODO: Implement + }); describe('CSI Ps ; Ps ; Ps t - Window Options', () => { it('should be disabled by default', async () => { await page.evaluate(`(() => { From 16f59002529d95e954d2ef152acefdd26ebce25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Sat, 19 Aug 2023 17:28:27 +0200 Subject: [PATCH 7/7] fix spaces in demo --- demo/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/client.ts b/demo/client.ts index 9e0cdeff..79611d53 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -1220,6 +1220,7 @@ stop at final '?': Maybe this one http://example.com/with?arguments=false? function coloredErase(): void { + const sp5 = ' '; const data = ` Test BG-colored Erase (BCE): The color block in the following lines should look identical. @@ -1227,7 +1228,7 @@ Test BG-colored Erase (BCE): for all cells to the right. def 41 42 43 44 45 46 47\x1b[47m -\x1b[m \x1b[41m \x1b[42m \x1b[43m \x1b[44m \x1b[45m \x1b[46m \x1b[47m +\x1b[m${sp5}\x1b[41m${sp5}\x1b[42m${sp5}\x1b[43m${sp5}\x1b[44m${sp5}\x1b[45m${sp5}\x1b[46m${sp5}\x1b[47m${sp5} \x1b[m\x1b[5X\x1b[41m\x1b[5C\x1b[5X\x1b[42m\x1b[5C\x1b[5X\x1b[43m\x1b[5C\x1b[5X\x1b[44m\x1b[5C\x1b[5X\x1b[45m\x1b[5C\x1b[5X\x1b[46m\x1b[5C\x1b[5X\x1b[47m\x1b[5C\x1b[5X\x1b[m `; term.write(data.split('\n').join('\r\n'));