diff --git a/addons/xterm-addon-serialize/src/SerializeAddon.api.ts b/addons/xterm-addon-serialize/src/SerializeAddon.api.ts index fdef10a2..a165411a 100644 --- a/addons/xterm-addon-serialize/src/SerializeAddon.api.ts +++ b/addons/xterm-addon-serialize/src/SerializeAddon.api.ts @@ -16,6 +16,7 @@ const height = 600; describe('SerializeAddon', () => { before(async function (): Promise { + this.timeout(8 * 1000); browser = await puppeteer.launch({ headless: process.argv.indexOf('--headless') !== -1, args: [`--window-size=${width},${height}`] diff --git a/demo/client.ts b/demo/client.ts index d607cb07..a4f79e77 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -391,10 +391,8 @@ function updateTerminalSize(): void { function serializeButtonHandler(): void { const output = addons.serialize.instance.serialize(); const outputString = JSON.stringify(output); - console.log('serialize output', outputString); document.getElementById('serialize-output').innerText = outputString; - if ((document.getElementById('write-to-terminal') as HTMLInputElement).checked) { term.reset(); term.write(output); diff --git a/demo/index.html b/demo/index.html index c55a818d..4d5149f3 100644 --- a/demo/index.html +++ b/demo/index.html @@ -11,22 +11,6 @@

xterm.js: A terminal for the web

-
-

Actions

-

- - - - - -

-
-

SerializeAddon

- - -
-
-

Options

These options can be set in the Terminal constructor or using the Terminal.setOption function.

@@ -36,6 +20,21 @@

Addons

Addons can be loaded and unloaded on a particular terminal to extend its functionality.

+

Addons Control

+

SearchAddon

+

+ + + + + +

+

SerializeAddon

+

+ + +

+

Style

diff --git a/demo/start.js b/demo/start.js index 8ffedb42..a14627c1 100644 --- a/demo/start.js +++ b/demo/start.js @@ -48,8 +48,7 @@ const clientConfig = { extensions: [ '.tsx', '.ts', '.js' ], alias: { common: path.resolve('./out/common'), - browser: path.resolve('./out/browser'), - xterm$: path.resolve('./out/public/Terminal.js') + browser: path.resolve('./out/browser') } }, output: { diff --git a/demo/style.css b/demo/style.css index 1ab5dc3c..9c5fd0bd 100644 --- a/demo/style.css +++ b/demo/style.css @@ -40,5 +40,4 @@ pre { word-break: break-all; word-wrap: break-word; white-space: pre-wrap; - word-wrap: break-word; } diff --git a/package.json b/package.json index fe98b468..b740e045 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ "tslint-consistent-codestyle": "^1.13.0", "typescript": "3.7", "utf8": "^3.0.0", - "v8-profiler-node8": "^6.1.1", "webpack": "^4.35.3", "webpack-cli": "^3.1.0", "ws": "^7.0.0", diff --git a/test/benchmark/SerializeAddon.benchmark.ts b/test/benchmark/SerializeAddon.benchmark.ts index 9423f400..3b8c4724 100644 --- a/test/benchmark/SerializeAddon.benchmark.ts +++ b/test/benchmark/SerializeAddon.benchmark.ts @@ -3,23 +3,16 @@ * @license MIT */ -import { perfContext, before, after, ThroughputRuntimeCase } from 'xterm-benchmark'; +import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark'; -import * as fs from 'fs' import { spawn } from 'node-pty'; -import * as profiler from 'v8-profiler-node8'; import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder'; import { Terminal } from 'public/Terminal'; import { SerializeAddon } from 'addons/xterm-addon-serialize/src/SerializeAddon'; class TestTerminal extends Terminal { writeSync(data: string): void { - (this)._core.writeBuffer.push(data); - (this)._core._innerWrite(); - } - writeSyncUtf8(data: Uint8Array): void { - (this)._core.writeBufferUtf8.push(data); - (this)._core._innerWriteUtf8(); + (this)._core.writeSync(data); } } @@ -59,24 +52,12 @@ perfContext('Terminal: sh -c "dd if=/dev/random count=40 bs=1k | hexdump | lolca perfContext('serialize', () => { let terminal: TestTerminal; - let serializeAddon = new SerializeAddon(); + const serializeAddon = new SerializeAddon(); before(() => { terminal = new TestTerminal({ cols: 80, rows: 25, scrollback: 5000 }); serializeAddon.activate(terminal); terminal.writeSync(content); - profiler.startProfiling(); }); - after(() => { - const p1 = profiler.stopProfiling(); - p1.export((err, res) => { - if (err) { - console.error(err); - return; - } - console.log(p1.getHeader()); - fs.writeFileSync('serialize-profile.cpuprofile', res); - }) - }) new ThroughputRuntimeCase('', () => { return { payloadSize: serializeAddon.serialize().length }; }, { fork: false }).showAverageThroughput();