Clean up
This commit is contained in:
@@ -178,7 +178,6 @@ if (config.isDemoClient) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (config.isWatch) {
|
if (config.isWatch) {
|
||||||
// TODO: This doesn't report errors?
|
|
||||||
context(bundleConfig).then(e => e.watch());
|
context(bundleConfig).then(e => e.watch());
|
||||||
if (!skipOut) {
|
if (!skipOut) {
|
||||||
context(outConfig).then(e => e.watch());
|
context(outConfig).then(e => e.watch());
|
||||||
|
|||||||
+9
-10
@@ -20,7 +20,7 @@ if ('WebAssembly' in window) {
|
|||||||
ImageAddon = imageAddon.ImageAddon;
|
ImageAddon = imageAddon.ImageAddon;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { Terminal as TerminalCtor, ITerminalOptions, type IDisposable } from '@xterm/xterm';
|
import { Terminal, ITerminalOptions, type IDisposable } from '@xterm/xterm';
|
||||||
import { AttachAddon } from '@xterm/addon-attach';
|
import { AttachAddon } from '@xterm/addon-attach';
|
||||||
import { CanvasAddon } from '@xterm/addon-canvas';
|
import { CanvasAddon } from '@xterm/addon-canvas';
|
||||||
import { ClipboardAddon } from '@xterm/addon-clipboard';
|
import { ClipboardAddon } from '@xterm/addon-clipboard';
|
||||||
@@ -35,8 +35,8 @@ import { Unicode11Addon } from '@xterm/addon-unicode11';
|
|||||||
import { UnicodeGraphemesAddon } from '@xterm/addon-unicode-graphemes';
|
import { UnicodeGraphemesAddon } from '@xterm/addon-unicode-graphemes';
|
||||||
|
|
||||||
export interface IWindowWithTerminal extends Window {
|
export interface IWindowWithTerminal extends Window {
|
||||||
term: TerminalCtor;
|
term: typeof Terminal;
|
||||||
Terminal: typeof TerminalCtor;
|
Terminal: typeof Terminal;
|
||||||
AttachAddon?: typeof AttachAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
AttachAddon?: typeof AttachAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
||||||
CanvasAddon?: typeof CanvasAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
CanvasAddon?: typeof CanvasAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
||||||
ClipboardAddon?: typeof ClipboardAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
ClipboardAddon?: typeof ClipboardAddon; // eslint-disable-line @typescript-eslint/naming-convention
|
||||||
@@ -219,7 +219,7 @@ const createNewWindowButtonHandler: () => void = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (document.location.pathname === '/test') {
|
if (document.location.pathname === '/test') {
|
||||||
window.Terminal = TerminalCtor;
|
window.Terminal = Terminal;
|
||||||
window.AttachAddon = AttachAddon;
|
window.AttachAddon = AttachAddon;
|
||||||
window.CanvasAddon = CanvasAddon;
|
window.CanvasAddon = CanvasAddon;
|
||||||
window.ClipboardAddon = ClipboardAddon;
|
window.ClipboardAddon = ClipboardAddon;
|
||||||
@@ -265,7 +265,7 @@ function createTerminal(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0;
|
const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].indexOf(navigator.platform) >= 0;
|
||||||
term = new TerminalCtor({
|
term = new Terminal({
|
||||||
allowProposedApi: true,
|
allowProposedApi: true,
|
||||||
windowsPty: isWindows ? {
|
windowsPty: isWindows ? {
|
||||||
// In a real scenario, these values should be verified on the backend
|
// In a real scenario, these values should be verified on the backend
|
||||||
@@ -277,7 +277,7 @@ function createTerminal(): void {
|
|||||||
} as ITerminalOptions);
|
} as ITerminalOptions);
|
||||||
|
|
||||||
// Load addons
|
// Load addons
|
||||||
const typedTerm = term as TerminalCtor;
|
const typedTerm = term as Terminal;
|
||||||
addons.search.instance = new SearchAddon();
|
addons.search.instance = new SearchAddon();
|
||||||
addons.serialize.instance = new SerializeAddon();
|
addons.serialize.instance = new SerializeAddon();
|
||||||
addons.fit.instance = new FitAddon();
|
addons.fit.instance = new FitAddon();
|
||||||
@@ -430,7 +430,7 @@ function runFakeTerminal(): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initOptions(term: TerminalCtor): void {
|
function initOptions(term: Terminal): void {
|
||||||
const blacklistedOptions = [
|
const blacklistedOptions = [
|
||||||
// Internal only options
|
// Internal only options
|
||||||
'cancelEvents',
|
'cancelEvents',
|
||||||
@@ -438,7 +438,6 @@ function initOptions(term: TerminalCtor): void {
|
|||||||
'termName',
|
'termName',
|
||||||
'cols', 'rows', // subsumed by "size" (colsRows) option
|
'cols', 'rows', // subsumed by "size" (colsRows) option
|
||||||
// Complex option
|
// Complex option
|
||||||
'documentOverride',
|
|
||||||
'linkHandler',
|
'linkHandler',
|
||||||
'logger',
|
'logger',
|
||||||
'theme',
|
'theme',
|
||||||
@@ -606,7 +605,7 @@ function initOptions(term: TerminalCtor): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initAddons(term: TerminalCtor): void {
|
function initAddons(term: Terminal): void {
|
||||||
const fragment = document.createDocumentFragment();
|
const fragment = document.createDocumentFragment();
|
||||||
Object.keys(addons).forEach((name: AddonType) => {
|
Object.keys(addons).forEach((name: AddonType) => {
|
||||||
const addon = addons[name];
|
const addon = addons[name];
|
||||||
@@ -1177,7 +1176,7 @@ function decorationStressTest(): void {
|
|||||||
}
|
}
|
||||||
decorationStressTestDecorations = undefined;
|
decorationStressTestDecorations = undefined;
|
||||||
} else {
|
} else {
|
||||||
const t = term as TerminalCtor;
|
const t = term as Terminal;
|
||||||
const buffer = t.buffer.active;
|
const buffer = t.buffer.active;
|
||||||
const cursorY = buffer.baseY + buffer.cursorY;
|
const cursorY = buffer.baseY + buffer.cursorY;
|
||||||
decorationStressTestDecorations = [];
|
decorationStressTestDecorations = [];
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
import { test } from '@playwright/test';
|
import { test } from '@playwright/test';
|
||||||
import { deepStrictEqual, ok, strictEqual } from 'assert';
|
|
||||||
import type { IDisposable } from '@xterm/xterm';
|
|
||||||
import { createTestContext, ITestContext, openTerminal, pollFor } from './TestUtils';
|
import { createTestContext, ITestContext, openTerminal, pollFor } from './TestUtils';
|
||||||
|
|
||||||
let ctx: ITestContext;
|
let ctx: ITestContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user