Merge branch 'master' into master

This commit is contained in:
Daniel Imms
2020-04-10 09:37:51 -07:00
committed by GitHub
19 changed files with 103 additions and 45 deletions
@@ -17,9 +17,8 @@ const height = 600;
describe('AttachAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
+2 -3
View File
@@ -17,9 +17,8 @@ const height = 768;
describe('FitAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -19,9 +19,8 @@ const height = 600;
describe('Search Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -17,9 +17,8 @@ const height = 600;
describe('SerializeAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -17,9 +17,8 @@ const height = 600;
describe('Unicode11Addon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -17,9 +17,8 @@ const height = 600;
describe('WebLinksAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -899,9 +899,8 @@ async function getCellColor(col: number, row: number): Promise<number[]> {
async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }): Promise<void> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
@@ -302,7 +302,7 @@ class CursorBlinkStateManager {
// the regular interval is setup in order to support restarting the blink
// animation in a lightweight way (without thrashing clearInterval and
// setInterval).
this._blinkStartTimeout = <number><any>setTimeout(() => {
this._blinkStartTimeout = window.setTimeout(() => {
// Check if another animation restart was requested while this was being
// started
if (this._animationTimeRestarted) {
@@ -322,7 +322,7 @@ class CursorBlinkStateManager {
});
// Setup the blink interval
this._blinkInterval = <number><any>setInterval(() => {
this._blinkInterval = window.setInterval(() => {
// Adjust the animation time if it was restarted
if (this._animationTimeRestarted) {
// calc time diff
@@ -360,6 +360,9 @@ class CursorBlinkStateManager {
}
public resume(terminal: Terminal): void {
// Clear out any existing timers just in case
this.pause();
this._animationTimeRestarted = undefined;
this._restartInterval();
this.restartBlinkAnimation(terminal);
+6 -1
View File
@@ -82,8 +82,13 @@ jobs:
vmImage: 'ubuntu-18.04'
steps:
- script: |
# source: https://github.com/microsoft/playwright/issues/1041
sudo apt update
sudo apt install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1
sudo apt install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libnotify4 libxslt1.1 libevent-2.1-6 libgles2 libgl1 libegl1 libvpx5
# for chromium
sudo apt install libnss3 libxss1 libasound2
# for firefox
sudo apt install libdbus-glib-1-2 libxt6
displayName: Install required packages
- task: NodeTool@0
inputs:
+49
View File
@@ -1445,4 +1445,53 @@ describe('InputHandler', () => {
assert.deepEqual(getLines(term), ['¥¥ ¥¥', '¥¥ ¥', '¥¥ ¥', '¥¥¥¥¥', '']);
});
});
describe('DECSTR', () => {
let term: TestTerminal;
beforeEach(() => {
term = new TestTerminal({cols: 10, rows: 5, scrollback: 1});
term.writeSync('01234567890123');
});
it('should reset IRM', () => {
term.writeSync('\x1b[4h');
assert.equal(term.insertMode, true);
term.writeSync('\x1b[!p');
assert.equal(term.insertMode, false);
});
it('should reset cursor visibility', () => {
term.writeSync('\x1b[?25l');
assert.equal((term as any)._coreService.isCursorHidden, true);
term.writeSync('\x1b[!p');
assert.equal((term as any)._coreService.isCursorHidden, false);
});
it('should reset scroll margins', () => {
term.writeSync('\x1b[2;4r');
assert.equal((term as any)._bufferService.buffer.scrollTop, 1);
assert.equal((term as any)._bufferService.buffer.scrollBottom, 3);
term.writeSync('\x1b[!p');
assert.equal((term as any)._bufferService.buffer.scrollTop, 0);
assert.equal((term as any)._bufferService.buffer.scrollBottom, term.rows - 1);
});
it('should reset text attributes', () => {
term.writeSync('\x1b[1;2;32;43m');
assert.equal(!!term.curAttrData.isBold(), true);
term.writeSync('\x1b[!p');
assert.equal(!!term.curAttrData.isBold(), false);
assert.equal(term.curAttrData.fg, 0);
assert.equal(term.curAttrData.bg, 0);
});
it('should reset DECSC data', () => {
term.writeSync('\x1b7');
assert.equal((term as any)._bufferService.buffer.savedX, 4);
assert.equal((term as any)._bufferService.buffer.savedY, 1);
term.writeSync('\x1b[!p');
assert.equal((term as any)._bufferService.buffer.savedX, 0);
assert.equal((term as any)._bufferService.buffer.savedY, 0);
});
it('should reset DECOM', () => {
term.writeSync('\x1b[?6h');
assert.equal((term as any)._coreService.decPrivateModes.origin, true);
term.writeSync('\x1b[!p');
assert.equal((term as any)._coreService.decPrivateModes.origin, false);
});
});
});
+12 -2
View File
@@ -2344,11 +2344,12 @@ export class InputHandler extends Disposable implements IInputHandler {
* DECSTR only resets certain attributes. For most needs DECSTR should be sufficient.
*
* The following terminal attributes are reset to default values:
* - cursor is reset (default = visible, home position)
* - IRM is reset (dafault = false)
* - scroll margins are reset (default = viewport size)
* - erase attributes are reset to default
* - charsets are reset
* - DECSC data is reset to initial values
* - DECOM is reset to absolute mode
*
*
* FIXME: there are several more attributes missing (see VT520 manual)
@@ -2360,9 +2361,18 @@ export class InputHandler extends Disposable implements IInputHandler {
this._bufferService.buffer.scrollTop = 0;
this._bufferService.buffer.scrollBottom = this._bufferService.rows - 1;
this._curAttrData = DEFAULT_ATTR_DATA.clone();
this._bufferService.buffer.x = this._bufferService.buffer.y = 0; // ?
this._coreService.reset();
this._charsetService.reset();
// reset DECSC data
this._bufferService.buffer.savedX = 0;
this._bufferService.buffer.savedY = this._bufferService.buffer.ybase;
this._bufferService.buffer.savedCurAttrData.fg = this._curAttrData.fg;
this._bufferService.buffer.savedCurAttrData.bg = this._curAttrData.bg;
this._bufferService.buffer.savedCharset = this._charsetService.charset;
// reset DECOM
this._coreService.decPrivateModes.origin = false;
}
/**
+1 -1
View File
@@ -476,7 +476,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
}
if (!document.body.contains(parent)) {
this._logService.warn('Terminal.open was called on an element that was not attached to the DOM');
this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');
}
this._document = parent.ownerDocument;
+1 -1
View File
@@ -192,7 +192,7 @@ export class ColorManager implements IColorManager {
const rgba: number = channels.toRgba(r, g, b, alpha);
return {
rgba,
css: channels.toCss(r, g, b, alpha)
css
};
}
+5 -2
View File
@@ -306,7 +306,7 @@ class CursorBlinkStateManager {
// the regular interval is setup in order to support restarting the blink
// animation in a lightweight way (without thrashing clearInterval and
// setInterval).
this._blinkStartTimeout = <number><any>setTimeout(() => {
this._blinkStartTimeout = window.setTimeout(() => {
// Check if another animation restart was requested while this was being
// started
if (this._animationTimeRestarted) {
@@ -326,7 +326,7 @@ class CursorBlinkStateManager {
});
// Setup the blink interval
this._blinkInterval = <number><any>setInterval(() => {
this._blinkInterval = window.setInterval(() => {
// Adjust the animation time if it was restarted
if (this._animationTimeRestarted) {
// calc time diff
@@ -364,6 +364,9 @@ class CursorBlinkStateManager {
}
public resume(): void {
// Clear out any existing timers just in case
this.pause();
this._animationTimeRestarted = undefined;
this._restartInterval();
this.restartBlinkAnimation();
+2 -3
View File
@@ -16,9 +16,8 @@ const height = 600;
describe('CharWidth Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
+2 -3
View File
@@ -21,9 +21,8 @@ describe('InputHandler Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
isChromium = browserType.name() === 'chromium';
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
+2 -3
View File
@@ -213,9 +213,8 @@ describe('Mouse Tracking Tests', async () => {
const itMouse = isChromium ? it : it.skip;
before(async function(): Promise<void> {
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
+2 -3
View File
@@ -17,9 +17,8 @@ const height = 600;
describe('Parser Integration Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
+2 -3
View File
@@ -17,9 +17,8 @@ const height = 600;
describe('API Integration Tests', function(): void {
before(async () => {
const browserType = getBrowserType();
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });