From 157055c03ba861d9b5a5153b19aa21039c1d08b1 Mon Sep 17 00:00:00 2001 From: joyceerhl Date: Sun, 10 Jan 2021 00:14:29 -0800 Subject: [PATCH 01/42] Original files --- src/common/public/Terminal.ts | 339 +++++++++ typings/xterm-core.d.ts | 1207 +++++++++++++++++++++++++++++++++ 2 files changed, 1546 insertions(+) create mode 100644 src/common/public/Terminal.ts create mode 100644 typings/xterm-core.d.ts diff --git a/src/common/public/Terminal.ts b/src/common/public/Terminal.ts new file mode 100644 index 00000000..70247f88 --- /dev/null +++ b/src/common/public/Terminal.ts @@ -0,0 +1,339 @@ +/** + * Copyright (c) 2018 The xterm.js authors. All rights reserved. + * @license MIT + */ + +import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, ILinkProvider, IUnicodeHandling, IUnicodeVersionProvider, FontWeight } from 'xterm'; +import { ITerminal } from 'browser/Types'; +import { IBufferLine, ICellData } from 'common/Types'; +import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { CellData } from 'common/buffer/CellData'; +import { Terminal as TerminalCore } from '../Terminal'; +import * as Strings from '../LocalizableStrings'; +import { IEvent, EventEmitter } from 'common/EventEmitter'; +import { AddonManager } from './AddonManager'; +import { IParams } from 'common/parser/Types'; +import { BufferSet } from 'common/buffer/BufferSet'; + +export class Terminal implements ITerminalApi { + private _core: ITerminal; + private _addonManager: AddonManager; + private _parser: IParser | undefined; + private _buffer: BufferNamespaceApi | undefined; + + constructor(options?: ITerminalOptions) { + this._core = new TerminalCore(options); + this._addonManager = new AddonManager(); + } + + private _checkProposedApi(): void { + if (!this._core.optionsService.options.allowProposedApi) { + throw new Error('You must set the allowProposedApi option to true to use proposed API'); + } + } + + public get onCursorMove(): IEvent { return this._core.onCursorMove; } + public get onLineFeed(): IEvent { return this._core.onLineFeed; } + public get onSelectionChange(): IEvent { return this._core.onSelectionChange; } + public get onData(): IEvent { return this._core.onData; } + public get onBinary(): IEvent { return this._core.onBinary; } + public get onTitleChange(): IEvent { return this._core.onTitleChange; } + public get onScroll(): IEvent { return this._core.onScroll; } + public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; } + public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; } + public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; } + + public get element(): HTMLElement | undefined { return this._core.element; } + public get parser(): IParser { + this._checkProposedApi(); + if (!this._parser) { + this._parser = new ParserApi(this._core); + } + return this._parser; + } + public get unicode(): IUnicodeHandling { + this._checkProposedApi(); + return new UnicodeApi(this._core); + } + public get textarea(): HTMLTextAreaElement | undefined { return this._core.textarea; } + public get rows(): number { return this._core.rows; } + public get cols(): number { return this._core.cols; } + public get buffer(): IBufferNamespaceApi { + this._checkProposedApi(); + if (!this._buffer) { + this._buffer = new BufferNamespaceApi(this._core); + } + return this._buffer; + } + public get markers(): ReadonlyArray { + this._checkProposedApi(); + return this._core.markers; + } + public blur(): void { + this._core.blur(); + } + public focus(): void { + this._core.focus(); + } + public resize(columns: number, rows: number): void { + this._verifyIntegers(columns, rows); + this._core.resize(columns, rows); + } + public open(parent: HTMLElement): void { + this._core.open(parent); + } + public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void { + this._core.attachCustomKeyEventHandler(customKeyEventHandler); + } + public registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number { + this._checkProposedApi(); + return this._core.registerLinkMatcher(regex, handler, options); + } + public deregisterLinkMatcher(matcherId: number): void { + this._checkProposedApi(); + this._core.deregisterLinkMatcher(matcherId); + } + public registerLinkProvider(linkProvider: ILinkProvider): IDisposable { + this._checkProposedApi(); + return this._core.registerLinkProvider(linkProvider); + } + public registerCharacterJoiner(handler: (text: string) => [number, number][]): number { + this._checkProposedApi(); + return this._core.registerCharacterJoiner(handler); + } + public deregisterCharacterJoiner(joinerId: number): void { + this._checkProposedApi(); + this._core.deregisterCharacterJoiner(joinerId); + } + public registerMarker(cursorYOffset: number): IMarker | undefined { + this._checkProposedApi(); + this._verifyIntegers(cursorYOffset); + return this._core.addMarker(cursorYOffset); + } + public addMarker(cursorYOffset: number): IMarker | undefined { + return this.registerMarker(cursorYOffset); + } + public hasSelection(): boolean { + return this._core.hasSelection(); + } + public select(column: number, row: number, length: number): void { + this._verifyIntegers(column, row, length); + this._core.select(column, row, length); + } + public getSelection(): string { + return this._core.getSelection(); + } + public getSelectionPosition(): ISelectionPosition | undefined { + return this._core.getSelectionPosition(); + } + public clearSelection(): void { + this._core.clearSelection(); + } + public selectAll(): void { + this._core.selectAll(); + } + public selectLines(start: number, end: number): void { + this._verifyIntegers(start, end); + this._core.selectLines(start, end); + } + public dispose(): void { + this._addonManager.dispose(); + this._core.dispose(); + } + public scrollLines(amount: number): void { + this._verifyIntegers(amount); + this._core.scrollLines(amount); + } + public scrollPages(pageCount: number): void { + this._verifyIntegers(pageCount); + this._core.scrollPages(pageCount); + } + public scrollToTop(): void { + this._core.scrollToTop(); + } + public scrollToBottom(): void { + this._core.scrollToBottom(); + } + public scrollToLine(line: number): void { + this._verifyIntegers(line); + this._core.scrollToLine(line); + } + public clear(): void { + this._core.clear(); + } + public write(data: string | Uint8Array, callback?: () => void): void { + this._core.write(data, callback); + } + public writeUtf8(data: Uint8Array, callback?: () => void): void { + this._core.write(data, callback); + } + public writeln(data: string | Uint8Array, callback?: () => void): void { + this._core.write(data); + this._core.write('\r\n', callback); + } + public paste(data: string): void { + this._core.paste(data); + } + public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string; + public getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean; + public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; + public getOption(key: 'fontWeight' | 'fontWeightBold'): FontWeight; + public getOption(key: string): any; + public getOption(key: any): any { + return this._core.optionsService.getOption(key); + } + public setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void; + public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void; + public setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void; + public setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void; + public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void; + public setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void; + public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; + public setOption(key: 'theme', value: ITheme): void; + public setOption(key: 'cols' | 'rows', value: number): void; + public setOption(key: string, value: any): void; + public setOption(key: any, value: any): void { + this._core.optionsService.setOption(key, value); + } + public refresh(start: number, end: number): void { + this._verifyIntegers(start, end); + this._core.refresh(start, end); + } + public reset(): void { + this._core.reset(); + } + public loadAddon(addon: ITerminalAddon): void { + return this._addonManager.loadAddon(this, addon); + } + public static get strings(): ILocalizableStrings { + return Strings; + } + + private _verifyIntegers(...values: number[]): void { + for (const value of values) { + if (value === Infinity || isNaN(value) || value % 1 !== 0) { + throw new Error('This API only accepts integers'); + } + } + } +} + +class BufferApiView implements IBufferApi { + constructor( + private _buffer: IBuffer, + public readonly type: 'normal' | 'alternate' + ) { } + + public init(buffer: IBuffer): BufferApiView { + this._buffer = buffer; + return this; + } + + public get cursorY(): number { return this._buffer.y; } + public get cursorX(): number { return this._buffer.x; } + public get viewportY(): number { return this._buffer.ydisp; } + public get baseY(): number { return this._buffer.ybase; } + public get length(): number { return this._buffer.lines.length; } + public getLine(y: number): IBufferLineApi | undefined { + const line = this._buffer.lines.get(y); + if (!line) { + return undefined; + } + return new BufferLineApiView(line); + } + public getNullCell(): IBufferCellApi { return new CellData(); } +} + +class BufferNamespaceApi implements IBufferNamespaceApi { + private _normal: BufferApiView; + private _alternate: BufferApiView; + private _onBufferChange = new EventEmitter(); + public get onBufferChange(): IEvent { return this._onBufferChange.event; } + + constructor(private _core: ITerminal) { + this._normal = new BufferApiView(this._core.buffers.normal, 'normal'); + this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate'); + this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active)); + } + public get active(): IBufferApi { + if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; } + if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; } + throw new Error('Active buffer is neither normal nor alternate'); + } + public get normal(): IBufferApi { + return this._normal.init(this._core.buffers.normal); + } + public get alternate(): IBufferApi { + return this._alternate.init(this._core.buffers.alt); + } +} + +class BufferLineApiView implements IBufferLineApi { + constructor(private _line: IBufferLine) { } + + public get isWrapped(): boolean { return this._line.isWrapped; } + public get length(): number { return this._line.length; } + public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined { + if (x < 0 || x >= this._line.length) { + return undefined; + } + + if (cell) { + this._line.loadCell(x, cell); + return cell; + } + return this._line.loadCell(x, new CellData()); + } + public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string { + return this._line.translateToString(trimRight, startColumn, endColumn); + } +} + +class ParserApi implements IParser { + constructor(private _core: ITerminal) { } + + public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable { + return this._core.addCsiHandler(id, (params: IParams) => callback(params.toArray())); + } + public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable { + return this.registerCsiHandler(id, callback); + } + public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable { + return this._core.addDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray())); + } + public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable { + return this.registerDcsHandler(id, callback); + } + public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable { + return this._core.addEscHandler(id, handler); + } + public addEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable { + return this.registerEscHandler(id, handler); + } + public registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable { + return this._core.addOscHandler(ident, callback); + } + public addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable { + return this.registerOscHandler(ident, callback); + } +} + +class UnicodeApi implements IUnicodeHandling { + constructor(private _core: ITerminal) { } + + public register(provider: IUnicodeVersionProvider): void { + this._core.unicodeService.register(provider); + } + + public get versions(): string[] { + return this._core.unicodeService.versions; + } + + public get activeVersion(): string { + return this._core.unicodeService.activeVersion; + } + + public set activeVersion(version: string) { + this._core.unicodeService.activeVersion = version; + } +} diff --git a/typings/xterm-core.d.ts b/typings/xterm-core.d.ts new file mode 100644 index 00000000..06964ca0 --- /dev/null +++ b/typings/xterm-core.d.ts @@ -0,0 +1,1207 @@ +/** + * @license MIT + * + * This contains the type declarations for the xterm.js library. Note that + * some interfaces differ between this file and the actual implementation in + * src/, that's because this file declares the *public* API which is intended + * to be stable and consumed by external programs. + */ + +declare module 'xterm-core' { + /** + * A string representing log level. + */ + export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off'; + + /** + * An object containing start up options for the terminal. + */ + export interface ITerminalOptions { + /** + * Whether to allow the use of proposed API. When false, any usage of APIs + * marked as experimental/proposed will throw an error. This defaults to + * true currently, but will change to false in v5.0. + */ + allowProposedApi?: boolean; + + /** + * Whether background should support non-opaque color. It must be set before + * executing the `Terminal.open()` method and can't be changed later without + * executing it again. Note that enabling this can negatively impact + * performance. + */ + allowTransparency?: boolean; + + /** + * If enabled, alt + click will move the prompt cursor to position + * underneath the mouse. The default is true. + */ + altClickMovesCursor?: boolean; + + /** + * A data uri of the sound to use for the bell when `bellStyle = 'sound'`. + */ + bellSound?: string; + + /** + * The type of the bell notification the terminal will use. + */ + bellStyle?: 'none' | 'sound'; + + /** + * When enabled the cursor will be set to the beginning of the next line + * with every new line. This is equivalent to sending '\r\n' for each '\n'. + * Normally the termios settings of the underlying PTY deals with the + * translation of '\n' to '\r\n' and this setting should not be used. If you + * deal with data from a non-PTY related source, this settings might be + * useful. + */ + convertEol?: boolean; + + /** + * The number of columns in the terminal. + */ + cols?: number; + + /** + * Whether the cursor blinks. + */ + cursorBlink?: boolean; + + /** + * The style of the cursor. + */ + cursorStyle?: 'block' | 'underline' | 'bar'; + + /** + * The width of the cursor in CSS pixels when `cursorStyle` is set to 'bar'. + */ + cursorWidth?: number; + + /** + * Whether input should be disabled. + */ + disableStdin?: boolean; + + /** + * Whether to draw bold text in bright colors. The default is true. + */ + drawBoldTextInBrightColors?: boolean; + + /** + * The modifier key hold to multiply scroll speed. + */ + fastScrollModifier?: 'alt' | 'ctrl' | 'shift' | undefined; + + /** + * The spacing in whole pixels between characters. + */ + letterSpacing?: number; + + /** + * The line height used to render text. + */ + lineHeight?: number; + + /** + * The duration in milliseconds before link tooltip events fire when + * hovering on a link. + * @deprecated This will be removed when the link matcher API is removed. + */ + linkTooltipHoverDuration?: number; + + /** + * What log level to use, this will log for all levels below and including + * what is set: + * + * 1. debug + * 2. info (default) + * 3. warn + * 4. error + * 5. off + */ + logLevel?: LogLevel; + + /** + * Whether to treat option as the meta key. + */ + macOptionIsMeta?: boolean; + + /** + * Whether holding a modifier key will force normal selection behavior, + * regardless of whether the terminal is in mouse events mode. This will + * also prevent mouse events from being emitted by the terminal. For + * example, this allows you to use xterm.js' regular selection inside tmux + * with mouse mode enabled. + */ + macOptionClickForcesSelection?: boolean; + + /** + * The minimum contrast ratio for text in the terminal, setting this will + * change the foreground color dynamically depending on whether the contrast + * ratio is met. Example values: + * + * - 1: The default, do nothing. + * - 4.5: Minimum for WCAG AA compliance. + * - 7: Minimum for WCAG AAA compliance. + * - 21: White on black or black on white. + */ + minimumContrastRatio?: number; + + /** + * Whether to select the word under the cursor on right click, this is + * standard behavior in a lot of macOS applications. + */ + rightClickSelectsWord?: boolean; + + /** + * The number of rows in the terminal. + */ + rows?: number; + + /** + * Whether screen reader support is enabled. When on this will expose + * supporting elements in the DOM to support NVDA on Windows and VoiceOver + * on macOS. + */ + screenReaderMode?: boolean; + + /** + * The amount of scrollback in the terminal. Scrollback is the amount of + * rows that are retained when lines are scrolled beyond the initial + * viewport. + */ + scrollback?: number; + + /** + * The scrolling speed multiplier used for adjusting normal scrolling speed. + */ + scrollSensitivity?: number; + + /** + * The size of tab stops in the terminal. + */ + tabStopWidth?: number; + + /** + * The color theme of the terminal. + */ + theme?: ITheme; + + /** + * Whether "Windows mode" is enabled. Because Windows backends winpty and + * conpty operate by doing line wrapping on their side, xterm.js does not + * have access to wrapped lines. When Windows mode is enabled the following + * changes will be in effect: + * + * - Reflow is disabled. + * - Lines are assumed to be wrapped if the last character of the line is + * not whitespace. + */ + windowsMode?: boolean; + + /** + * A string containing all characters that are considered word separated by the + * double click to select work logic. + */ + wordSeparator?: string; + + /** + * Enable various window manipulation and report features. + * All features are disabled by default for security reasons. + */ + windowOptions?: IWindowOptions; + } + + /** + * Contains colors to theme the terminal with. + */ + export interface ITheme { + /** The default foreground color */ + foreground?: string; + /** The default background color */ + background?: string; + /** The cursor color */ + cursor?: string; + /** The accent color of the cursor (fg color for a block cursor) */ + cursorAccent?: string; + /** The selection background color (can be transparent) */ + selection?: string; + /** ANSI black (eg. `\x1b[30m`) */ + black?: string; + /** ANSI red (eg. `\x1b[31m`) */ + red?: string; + /** ANSI green (eg. `\x1b[32m`) */ + green?: string; + /** ANSI yellow (eg. `\x1b[33m`) */ + yellow?: string; + /** ANSI blue (eg. `\x1b[34m`) */ + blue?: string; + /** ANSI magenta (eg. `\x1b[35m`) */ + magenta?: string; + /** ANSI cyan (eg. `\x1b[36m`) */ + cyan?: string; + /** ANSI white (eg. `\x1b[37m`) */ + white?: string; + /** ANSI bright black (eg. `\x1b[1;30m`) */ + brightBlack?: string; + /** ANSI bright red (eg. `\x1b[1;31m`) */ + brightRed?: string; + /** ANSI bright green (eg. `\x1b[1;32m`) */ + brightGreen?: string; + /** ANSI bright yellow (eg. `\x1b[1;33m`) */ + brightYellow?: string; + /** ANSI bright blue (eg. `\x1b[1;34m`) */ + brightBlue?: string; + /** ANSI bright magenta (eg. `\x1b[1;35m`) */ + brightMagenta?: string; + /** ANSI bright cyan (eg. `\x1b[1;36m`) */ + brightCyan?: string; + /** ANSI bright white (eg. `\x1b[1;37m`) */ + brightWhite?: string; + } + + /** + * An object that can be disposed via a dispose function. + */ + export interface IDisposable { + dispose(): void; + } + + /** + * An event that can be listened to. + * @returns an `IDisposable` to stop listening. + */ + export interface IEvent { + (listener: (arg1: T, arg2: U) => any): IDisposable; + } + + /** + * Represents a specific line in the terminal that is tracked when scrollback + * is trimmed and lines are added or removed. This is a single line that may + * be part of a larger wrapped line. + */ + export interface IMarker extends IDisposable { + /** + * A unique identifier for this marker. + */ + readonly id: number; + + /** + * Whether this marker is disposed. + */ + readonly isDisposed: boolean; + + /** + * The actual line index in the buffer at this point in time. This is set to + * -1 if the marker has been disposed. + */ + readonly line: number; + + /** + * Event listener to get notified when the marker gets disposed. Automatic disposal + * might happen for a marker, that got invalidated by scrolling out or removal of + * a line from the buffer. + */ + onDispose: IEvent; + } + + /** + * The set of localizable strings. + */ + export interface ILocalizableStrings { + /** + * The aria label for the underlying input textarea for the terminal. + */ + promptLabel: string; + + /** + * Announcement for when line reading is suppressed due to too many lines + * being printed to the terminal when `screenReaderMode` is enabled. + */ + tooMuchOutput: string; + } + + /** + * Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t). + * + * Most settings have no default implementation, as they heavily rely on + * the embedding environment. + * + * To implement a feature, create a custom CSI hook like this: + * ```ts + * term.parser.addCsiHandler({final: 't'}, params => { + * const ps = params[0]; + * switch (ps) { + * case XY: + * ... // your implementation for option XY + * return true; // signal Ps=XY was handled + * } + * return false; // any Ps that was not handled + * }); + * ``` + * + * Note on security: + * Most features are meant to deal with some information of the host machine + * where the terminal runs on. This is seen as a security risk possibly leaking + * sensitive data of the host to the program in the terminal. Therefore all options + * (even those without a default implementation) are guarded by the boolean flag + * and disabled by default. + */ + export interface IWindowOptions { + /** + * Ps=1 De-iconify window. + * No default implementation. + */ + restoreWin?: boolean; + /** + * Ps=2 Iconify window. + * No default implementation. + */ + minimizeWin?: boolean; + /** + * Ps=3 ; x ; y + * Move window to [x, y]. + * No default implementation. + */ + setWinPosition?: boolean; + /** + * Ps = 4 ; height ; width + * Resize the window to given `height` and `width` in pixels. + * Omitted parameters should reuse the current height or width. + * Zero parameters should use the display's height or width. + * No default implementation. + */ + setWinSizePixels?: boolean; + /** + * Ps=5 Raise the window to the front of the stacking order. + * No default implementation. + */ + raiseWin?: boolean; + /** + * Ps=6 Lower the xterm window to the bottom of the stacking order. + * No default implementation. + */ + lowerWin?: boolean; + /** Ps=7 Refresh the window. */ + refreshWin?: boolean; + /** + * Ps = 8 ; height ; width + * Resize the text area to given height and width in characters. + * Omitted parameters should reuse the current height or width. + * Zero parameters use the display's height or width. + * No default implementation. + */ + setWinSizeChars?: boolean; + /** + * Ps=9 ; 0 Restore maximized window. + * Ps=9 ; 1 Maximize window (i.e., resize to screen size). + * Ps=9 ; 2 Maximize window vertically. + * Ps=9 ; 3 Maximize window horizontally. + * No default implementation. + */ + maximizeWin?: boolean; + /** + * Ps=10 ; 0 Undo full-screen mode. + * Ps=10 ; 1 Change to full-screen. + * Ps=10 ; 2 Toggle full-screen. + * No default implementation. + */ + fullscreenWin?: boolean; + /** Ps=11 Report xterm window state. + * If the xterm window is non-iconified, it returns "CSI 1 t". + * If the xterm window is iconified, it returns "CSI 2 t". + * No default implementation. + */ + getWinState?: boolean; + /** + * Ps=13 Report xterm window position. Result is "CSI 3 ; x ; y t". + * Ps=13 ; 2 Report xterm text-area position. Result is "CSI 3 ; x ; y t". + * No default implementation. + */ + getWinPosition?: boolean; + /** + * Ps=14 Report xterm text area size in pixels. Result is "CSI 4 ; height ; width t". + * Ps=14 ; 2 Report xterm window size in pixels. Result is "CSI 4 ; height ; width t". + * Has a default implementation. + */ + getWinSizePixels?: boolean; + /** + * Ps=15 Report size of the screen in pixels. Result is "CSI 5 ; height ; width t". + * No default implementation. + */ + getScreenSizePixels?: boolean; + /** + * Ps=16 Report xterm character cell size in pixels. Result is "CSI 6 ; height ; width t". + * Has a default implementation. + */ + getCellSizePixels?: boolean; + /** + * Ps=18 Report the size of the text area in characters. Result is "CSI 8 ; height ; width t". + * Has a default implementation. + */ + getWinSizeChars?: boolean; + /** + * Ps=19 Report the size of the screen in characters. Result is "CSI 9 ; height ; width t". + * No default implementation. + */ + getScreenSizeChars?: boolean; + /** + * Ps=20 Report xterm window's icon label. Result is "OSC L label ST". + * No default implementation. + */ + getIconTitle?: boolean; + /** + * Ps=21 Report xterm window's title. Result is "OSC l label ST". + * No default implementation. + */ + getWinTitle?: boolean; + /** + * Ps=22 ; 0 Save xterm icon and window title on stack. + * Ps=22 ; 1 Save xterm icon title on stack. + * Ps=22 ; 2 Save xterm window title on stack. + * All variants have a default implementation. + */ + pushTitle?: boolean; + /** + * Ps=23 ; 0 Restore xterm icon and window title from stack. + * Ps=23 ; 1 Restore xterm icon title from stack. + * Ps=23 ; 2 Restore xterm window title from stack. + * All variants have a default implementation. + */ + popTitle?: boolean; + /** + * Ps>=24 Resize to Ps lines (DECSLPP). + * DECSLPP is not implemented. This settings is also used to + * enable / disable DECCOLM (earlier variant of DECSLPP). + */ + setWinLines?: boolean; + } + + /** + * The class that represents an xterm.js terminal. + */ + export class Terminal implements IDisposable { + /** + * The number of rows in the terminal's viewport. Use + * `ITerminalOptions.rows` to set this in the constructor and + * `Terminal.resize` for when the terminal exists. + */ + readonly rows: number; + + /** + * The number of columns in the terminal's viewport. Use + * `ITerminalOptions.cols` to set this in the constructor and + * `Terminal.resize` for when the terminal exists. + */ + readonly cols: number; + + /** + * (EXPERIMENTAL) The terminal's current buffer, this might be either the + * normal buffer or the alt buffer depending on what's running in the + * terminal. + */ + readonly buffer: IBufferNamespace; + + /** + * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt + * buffer is active this will always return []. + */ + readonly markers: ReadonlyArray; + + /** + * (EXPERIMENTAL) Get the parser interface to register + * custom escape sequence handlers. + */ + readonly parser: IParser; + + /** + * (EXPERIMENTAL) Get the Unicode handling interface + * to register and switch Unicode version. + */ + readonly unicode: IUnicodeHandling; + + /** + * Natural language strings that can be localized. + */ + static strings: ILocalizableStrings; + + /** + * Creates a new `Terminal` object. + * + * @param options An object containing a set of options. + */ + constructor(options?: ITerminalOptions); + + /** + * Adds an event listener for when a binary event fires. This is used to + * enable non UTF-8 conformant binary messages to be sent to the backend. + * Currently this is only used for a certain type of mouse reports that + * happen to be not UTF-8 compatible. + * The event value is a JS string, pass it to the underlying pty as + * binary data, e.g. `pty.write(Buffer.from(data, 'binary'))`. + * @returns an `IDisposable` to stop listening. + */ + onBinary: IEvent; + + /** + * Adds an event listener for the cursor moves. + * @returns an `IDisposable` to stop listening. + */ + onCursorMove: IEvent; + + /** + * Adds an event listener for when a data event fires. This happens for + * example when the user types or pastes into the terminal. The event value + * is whatever `string` results, in a typical setup, this should be passed + * on to the backing pty. + * @returns an `IDisposable` to stop listening. + */ + onData: IEvent; + + /** + * Adds an event listener for when a line feed is added. + * @returns an `IDisposable` to stop listening. + */ + onLineFeed: IEvent; + + /** + * Adds an event listener for when the terminal is resized. The event value + * contains the new size. + * @returns an `IDisposable` to stop listening. + */ + onResize: IEvent<{ cols: number, rows: number }>; + + /** + * Adds an event listener for when an OSC 0 or OSC 2 title change occurs. + * The event value is the new title. + * @returns an `IDisposable` to stop listening. + */ + onTitleChange: IEvent; + + /** + * Resizes the terminal. It's best practice to debounce calls to resize, + * this will help ensure that the pty can respond to the resize event + * before another one occurs. + * @param x The number of columns to resize to. + * @param y The number of rows to resize to. + */ + resize(columns: number, rows: number): void; + + /** + * (EXPERIMENTAL) Adds a marker to the normal buffer and returns it. If the + * alt buffer is active, undefined is returned. + * @param cursorYOffset The y position offset of the marker from the cursor. + * @returns The new marker or undefined. + */ + registerMarker(cursorYOffset: number): IMarker | undefined; + + /** + * @deprecated use `registerMarker` instead. + */ + addMarker(cursorYOffset: number): IMarker | undefined; + + /* + * Disposes of the terminal, detaching it from the DOM and removing any + * active listeners. + */ + dispose(): void; + + /** + * Clear the entire buffer, making the prompt line the new first line. + */ + clear(): void; + + /** + * Write data to the terminal. + * @param data The data to write to the terminal. This can either be raw + * bytes given as Uint8Array from the pty or a string. Raw bytes will always + * be treated as UTF-8 encoded, string data as UTF-16. + * @param callback Optional callback that fires when the data was processed + * by the parser. + */ + write(data: string | Uint8Array, callback?: () => void): void; + + /** + * Writes data to the terminal, followed by a break line character (\n). + * @param data The data to write to the terminal. This can either be raw + * bytes given as Uint8Array from the pty or a string. Raw bytes will always + * be treated as UTF-8 encoded, string data as UTF-16. + * @param callback Optional callback that fires when the data was processed + * by the parser. + */ + writeln(data: string | Uint8Array, callback?: () => void): void; + + /** + * Write UTF8 data to the terminal. + * @param data The data to write to the terminal. + * @param callback Optional callback when data was processed. + * @deprecated use `write` instead + */ + writeUtf8(data: Uint8Array, callback?: () => void): void; + + /** + * Retrieves an option's value from the terminal. + * @param key The option key. + */ + getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string; + /** + * Retrieves an option's value from the terminal. + * @param key The option key. + */ + getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell' | 'windowsMode'): boolean; + /** + * Retrieves an option's value from the terminal. + * @param key The option key. + */ + getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; + /** + * Retrieves an option's value from the terminal. + * @param key The option key. + */ + getOption(key: string): any; + + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'fontFamily' | 'termName' | 'bellSound' | 'wordSeparator', value: string): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'fontWeight' | 'fontWeightBold', value: null | 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'logLevel', value: LogLevel): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'bellStyle', value: null | 'none' | 'visual' | 'sound' | 'both'): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'cursorStyle', value: null | 'block' | 'underline' | 'bar'): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'visualBell' | 'windowsMode', value: boolean): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'theme', value: ITheme): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: 'cols' | 'rows', value: number): void; + /** + * Sets an option on the terminal. + * @param key The option key. + * @param value The option value. + */ + setOption(key: string, value: any): void; + + /** + * Perform a full reset (RIS, aka '\x1bc'). + */ + reset(): void; + } + + /** + * An addon that can provide additional functionality to the terminal. + */ + export interface ITerminalAddon extends IDisposable { + /** + * This is called when the addon is activated. + */ + activate(terminal: Terminal): void; + } + + /** + * An object representing a selection within the terminal. + */ + interface ISelectionPosition { + /** + * The start column of the selection. + */ + startColumn: number; + + /** + * The start row of the selection. + */ + startRow: number; + + /** + * The end column of the selection. + */ + endColumn: number; + + /** + * The end row of the selection. + */ + endRow: number; + } + + /** + * An object representing a range within the viewport of the terminal. + */ + export interface IViewportRange { + /** + * The start of the range. + */ + start: IViewportRangePosition; + + /** + * The end of the range. + */ + end: IViewportRangePosition; + } + + /** + * An object representing a cell position within the viewport of the terminal. + */ + interface IViewportRangePosition { + /** + * The x position of the cell. This is a 0-based index that refers to the + * space in between columns, not the column itself. Index 0 refers to the + * left side of the viewport, index `Terminal.cols` refers to the right side + * of the viewport. This can be thought of as how a cursor is positioned in + * a text editor. + */ + x: number; + + /** + * The y position of the cell. This is a 0-based index that refers to a + * specific row. + */ + y: number; + } + + /** + * A range within a buffer. + */ + interface IBufferRange { + /** + * The start position of the range. + */ + start: IBufferCellPosition; + + /** + * The end position of the range. + */ + end: IBufferCellPosition; + } + + /** + * A position within a buffer. + */ + interface IBufferCellPosition { + /** + * The x position within the buffer. + */ + x: number; + + /** + * The y position within the buffer. + */ + y: number; + } + + /** + * Represents a terminal buffer. + */ + interface IBuffer { + /** + * The type of the buffer. + */ + readonly type: 'normal' | 'alternate'; + + /** + * The y position of the cursor. This ranges between `0` (when the + * cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the + * last row). + */ + readonly cursorY: number; + + /** + * The x position of the cursor. This ranges between `0` (left side) and + * `Terminal.cols` (after last cell of the row). + */ + readonly cursorX: number; + + /** + * The line within the buffer where the top of the viewport is. + */ + readonly viewportY: number; + + /** + * The line within the buffer where the top of the bottom page is (when + * fully scrolled down). + */ + readonly baseY: number; + + /** + * The amount of lines in the buffer. + */ + readonly length: number; + + /** + * Gets a line from the buffer, or undefined if the line index does not + * exist. + * + * Note that the result of this function should be used immediately after + * calling as when the terminal updates it could lead to unexpected + * behavior. + * + * @param y The line index to get. + */ + getLine(y: number): IBufferLine | undefined; + + /** + * Creates an empty cell object suitable as a cell reference in + * `line.getCell(x, cell)`. Use this to avoid costly recreation of + * cell objects when dealing with tons of cells. + */ + getNullCell(): IBufferCell; + } + + /** + * Represents the terminal's set of buffers. + */ + interface IBufferNamespace { + /** + * The active buffer, this will either be the normal or alternate buffers. + */ + readonly active: IBuffer; + + /** + * The normal buffer. + */ + readonly normal: IBuffer; + + /** + * The alternate buffer, this becomes the active buffer when an application + * enters this mode via DECSET (`CSI ? 4 7 h`) + */ + readonly alternate: IBuffer; + + /** + * Adds an event listener for when the active buffer changes. + * @returns an `IDisposable` to stop listening. + */ + onBufferChange: IEvent; + } + + /** + * Represents a line in the terminal's buffer. + */ + interface IBufferLine { + /** + * Whether the line is wrapped from the previous line. + */ + readonly isWrapped: boolean; + + /** + * The length of the line, all call to getCell beyond the length will result + * in `undefined`. + */ + readonly length: number; + + /** + * Gets a cell from the line, or undefined if the line index does not exist. + * + * Note that the result of this function should be used immediately after + * calling as when the terminal updates it could lead to unexpected + * behavior. + * + * @param x The character index to get. + * @param cell Optional cell object to load data into for performance + * reasons. This is mainly useful when every cell in the buffer is being + * looped over to avoid creating new objects for every cell. + */ + getCell(x: number, cell?: IBufferCell): IBufferCell | undefined; + + /** + * Gets the line as a string. Note that this is gets only the string for the + * line, not taking isWrapped into account. + * + * @param trimRight Whether to trim any whitespace at the right of the line. + * @param startColumn The column to start from (inclusive). + * @param endColumn The column to end at (exclusive). + */ + translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string; + } + + /** + * Represents a single cell in the terminal's buffer. + */ + interface IBufferCell { + /** + * The width of the character. Some examples: + * + * - `1` for most cells. + * - `2` for wide character like CJK glyphs. + * - `0` for cells immediately following cells with a width of `2`. + */ + getWidth(): number; + + /** + * The character(s) within the cell. Examples of what this can contain: + * + * - A normal width character + * - A wide character (eg. CJK) + * - An emoji + */ + getChars(): string; + + /** + * Gets the UTF32 codepoint of single characters, if content is a combined + * string it returns the codepoint of the last character in the string. + */ + getCode(): number; + + /** + * Gets the number representation of the foreground color mode, this can be + * used to perform quick comparisons of 2 cells to see if they're the same. + * Use `isFgRGB`, `isFgPalette` and `isFgDefault` to check what color mode + * a cell is. + */ + getFgColorMode(): number; + + /** + * Gets the number representation of the background color mode, this can be + * used to perform quick comparisons of 2 cells to see if they're the same. + * Use `isBgRGB`, `isBgPalette` and `isBgDefault` to check what color mode + * a cell is. + */ + getBgColorMode(): number; + + /** + * Gets a cell's foreground color number, this differs depending on what the + * color mode of the cell is: + * + * - Default: This should be 0, representing the default foreground color + * (CSI 39 m). + * - Palette: This is a number from 0 to 255 of ANSI colors (CSI 3(0-7) m, + * CSI 9(0-7) m, CSI 38 ; 5 ; 0-255 m). + * - RGB: A hex value representing a 'true color': 0xRRGGBB. + * (CSI 3 8 ; 2 ; Pi ; Pr ; Pg ; Pb) + */ + getFgColor(): number; + + /** + * Gets a cell's background color number, this differs depending on what the + * color mode of the cell is: + * + * - Default: This should be 0, representing the default background color + * (CSI 49 m). + * - Palette: This is a number from 0 to 255 of ANSI colors + * (CSI 4(0-7) m, CSI 10(0-7) m, CSI 48 ; 5 ; 0-255 m). + * - RGB: A hex value representing a 'true color': 0xRRGGBB + * (CSI 4 8 ; 2 ; Pi ; Pr ; Pg ; Pb) + */ + getBgColor(): number; + + /** Whether the cell has the bold attribute (CSI 1 m). */ + isBold(): number; + /** Whether the cell has the inverse attribute (CSI 3 m). */ + isItalic(): number; + /** Whether the cell has the inverse attribute (CSI 2 m). */ + isDim(): number; + /** Whether the cell has the underline attribute (CSI 4 m). */ + isUnderline(): number; + /** Whether the cell has the inverse attribute (CSI 5 m). */ + isBlink(): number; + /** Whether the cell has the inverse attribute (CSI 7 m). */ + isInverse(): number; + /** Whether the cell has the inverse attribute (CSI 8 m). */ + isInvisible(): number; + + /** Whether the cell is using the RGB foreground color mode. */ + isFgRGB(): boolean; + /** Whether the cell is using the RGB background color mode. */ + isBgRGB(): boolean; + /** Whether the cell is using the palette foreground color mode. */ + isFgPalette(): boolean; + /** Whether the cell is using the palette background color mode. */ + isBgPalette(): boolean; + /** Whether the cell is using the default foreground color mode. */ + isFgDefault(): boolean; + /** Whether the cell is using the default background color mode. */ + isBgDefault(): boolean; + + /** Whether the cell has the default attribute (no color or style). */ + isAttributeDefault(): boolean; + } + + /** + * Data type to register a CSI, DCS or ESC callback in the parser + * in the form: + * ESC I..I F + * CSI Prefix P..P I..I F + * DCS Prefix P..P I..I F data_bytes ST + * + * with these rules/restrictions: + * - prefix can only be used with CSI and DCS + * - only one leading prefix byte is recognized by the parser + * before any other parameter bytes (P..P) + * - intermediate bytes are recognized up to 2 + * + * For custom sequences make sure to read ECMA-48 and the resources at + * vt100.net to not clash with existing sequences or reserved address space. + * General recommendations: + * - use private address space (see ECMA-48) + * - use max one intermediate byte (technically not limited by the spec, + * in practice there are no sequences with more than one intermediate byte, + * thus parsers might get confused with more intermediates) + * - test against other common emulators to check whether they escape/ignore + * the sequence correctly + * + * Notes: OSC command registration is handled differently (see addOscHandler) + * APC, PM or SOS is currently not supported. + */ + export interface IFunctionIdentifier { + /** + * Optional prefix byte, must be in range \x3c .. \x3f. + * Usable in CSI and DCS. + */ + prefix?: string; + /** + * Optional intermediate bytes, must be in range \x20 .. \x2f. + * Usable in CSI, DCS and ESC. + */ + intermediates?: string; + /** + * Final byte, must be in range \x40 .. \x7e for CSI and DCS, + * \x30 .. \x7e for ESC. + */ + final: string; + } + + /** + * Allows hooking into the parser for custom handling of escape sequences. + */ + export interface IParser { + /** + * Adds a handler for CSI escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {final: 'm'} for SGR. + * @param callback The function to handle the sequence. The callback is + * called with the numerical params. If the sequence has subparams the + * array will contain subarrays with their numercial values. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addCsiHandler or setCsiHandler). + * The most recently added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable; + + /** + * Adds a handler for DCS escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {intermediates: '$' final: 'q'} for DECRQSS. + * @param callback The function to handle the sequence. Note that the + * function will only be called once if the sequence finished sucessfully. + * There is currently no way to intercept smaller data chunks, data chunks + * will be stored up until the sequence is finished. Since DCS sequences + * are not limited by the amount of data this might impose a problem for + * big payloads. Currently xterm.js limits DCS payload to 10 MB + * which should give enough room for most use cases. + * The function gets the payload and numerical parameters as arguments. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addDcsHandler or setDcsHandler). + * The most recently added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable; + + /** + * Adds a handler for ESC escape sequences. + * @param id Specifies the function identifier under which the callback + * gets registered, e.g. {intermediates: '%' final: 'G'} for + * default charset selection. + * @param callback The function to handle the sequence. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addEscHandler or setEscHandler). + * The most recently added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable; + + /** + * Adds a handler for OSC escape sequences. + * @param ident The number (first parameter) of the sequence. + * @param callback The function to handle the sequence. Note that the + * function will only be called once if the sequence finished sucessfully. + * There is currently no way to intercept smaller data chunks, data chunks + * will be stored up until the sequence is finished. Since OSC sequences + * are not limited by the amount of data this might impose a problem for + * big payloads. Currently xterm.js limits OSC payload to 10 MB + * which should give enough room for most use cases. + * The callback is called with OSC data string. + * Return true if the sequence was handled; false if we should try + * a previous handler (set by addOscHandler or setOscHandler). + * The most recently added handler is tried first. + * @return An IDisposable you can call to remove this handler. + */ + registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; + } + + /** + * (EXPERIMENTAL) Unicode version provider. + * Used to register custom Unicode versions with `Terminal.unicode.register`. + */ + export interface IUnicodeVersionProvider { + /** + * String indicating the Unicode version provided. + */ + readonly version: string; + + /** + * Unicode version dependent wcwidth implementation. + */ + wcwidth(codepoint: number): 0 | 1 | 2; + } + + /** + * (EXPERIMENTAL) Unicode handling interface. + */ + export interface IUnicodeHandling { + /** + * Register a custom Unicode version provider. + */ + register(provider: IUnicodeVersionProvider): void; + + /** + * Registered Unicode versions. + */ + readonly versions: ReadonlyArray; + + /** + * Getter/setter for active Unicode version. + */ + activeVersion: string; + } + } + \ No newline at end of file From 5e6e65c8da6ee21bb8c669702aa7a3f4e91a10fa Mon Sep 17 00:00:00 2001 From: joyceerhl Date: Sun, 10 Jan 2021 22:18:41 -0800 Subject: [PATCH 02/42] Get dupe of src/browser/public/Terminal compiling --- core-webpack.config.js | 41 ++++++++ package.json | 1 + src/common/public/Terminal.ts | 108 +-------------------- src/common/public/TerminalCore.ts | 155 ++++++++++++++++++++++++++++++ src/common/public/tsconfig.json | 21 ++++ src/common/public/types.ts | 31 ++++++ 6 files changed, 253 insertions(+), 104 deletions(-) create mode 100644 core-webpack.config.js create mode 100644 src/common/public/TerminalCore.ts create mode 100644 src/common/public/tsconfig.json create mode 100644 src/common/public/types.ts diff --git a/core-webpack.config.js b/core-webpack.config.js new file mode 100644 index 00000000..85c37ff1 --- /dev/null +++ b/core-webpack.config.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019 The xterm.js authors. All rights reserved. + * @license MIT + */ + +const path = require('path'); + +/** + * This webpack config does a production build for xterm-core.js. It works by taking the output from tsc + * (via `yarn watch` or `yarn prebuild`) which are put into `xterm-core/` and webpacks them into a + * production mode commonjs library module in `lib/`. The aliases are used fix up the absolute paths + * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. + */ +module.exports = { + entry: './xterm-core/common/public/Terminal.js', + devtool: 'source-map', + module: { + rules: [ + { + test: /\.js$/, + use: ["source-map-loader"], + enforce: "pre", + exclude: /node_modules/ + } + ] + }, + resolve: { + modules: ['./node_modules'], + extensions: [ '.js' ], + alias: { + common: path.resolve('./xterm-core/common') + } + }, + output: { + filename: 'xterm-core.js', + path: path.resolve('./lib'), + libraryTarget: 'commonjs' + }, + mode: 'production', + target: 'node', +}; diff --git a/package.json b/package.json index 59902931..aa6f5a1b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "prepackage": "npm run build", "package": "webpack", + "compile": "tsc -b ./src/common/public/tsconfig.json", "start": "node demo/start", "lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/", "test": "npm run test-unit", diff --git a/src/common/public/Terminal.ts b/src/common/public/Terminal.ts index 70247f88..39ad5cd4 100644 --- a/src/common/public/Terminal.ts +++ b/src/common/public/Terminal.ts @@ -3,27 +3,22 @@ * @license MIT */ -import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, ILinkProvider, IUnicodeHandling, IUnicodeVersionProvider, FontWeight } from 'xterm'; -import { ITerminal } from 'browser/Types'; +import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, IUnicodeHandling, IUnicodeVersionProvider } from 'xterm-core'; import { IBufferLine, ICellData } from 'common/Types'; -import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { IBuffer } from 'common/buffer/Types'; import { CellData } from 'common/buffer/CellData'; -import { Terminal as TerminalCore } from '../Terminal'; -import * as Strings from '../LocalizableStrings'; +import { Terminal as TerminalCore } from './TerminalCore'; import { IEvent, EventEmitter } from 'common/EventEmitter'; -import { AddonManager } from './AddonManager'; import { IParams } from 'common/parser/Types'; -import { BufferSet } from 'common/buffer/BufferSet'; +import { ITerminal } from 'common/public/types'; export class Terminal implements ITerminalApi { private _core: ITerminal; - private _addonManager: AddonManager; private _parser: IParser | undefined; private _buffer: BufferNamespaceApi | undefined; constructor(options?: ITerminalOptions) { this._core = new TerminalCore(options); - this._addonManager = new AddonManager(); } private _checkProposedApi(): void { @@ -34,16 +29,11 @@ export class Terminal implements ITerminalApi { public get onCursorMove(): IEvent { return this._core.onCursorMove; } public get onLineFeed(): IEvent { return this._core.onLineFeed; } - public get onSelectionChange(): IEvent { return this._core.onSelectionChange; } public get onData(): IEvent { return this._core.onData; } public get onBinary(): IEvent { return this._core.onBinary; } public get onTitleChange(): IEvent { return this._core.onTitleChange; } - public get onScroll(): IEvent { return this._core.onScroll; } - public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; } - public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; } public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; } - public get element(): HTMLElement | undefined { return this._core.element; } public get parser(): IParser { this._checkProposedApi(); if (!this._parser) { @@ -55,7 +45,6 @@ export class Terminal implements ITerminalApi { this._checkProposedApi(); return new UnicodeApi(this._core); } - public get textarea(): HTMLTextAreaElement | undefined { return this._core.textarea; } public get rows(): number { return this._core.rows; } public get cols(): number { return this._core.cols; } public get buffer(): IBufferNamespaceApi { @@ -69,42 +58,10 @@ export class Terminal implements ITerminalApi { this._checkProposedApi(); return this._core.markers; } - public blur(): void { - this._core.blur(); - } - public focus(): void { - this._core.focus(); - } public resize(columns: number, rows: number): void { this._verifyIntegers(columns, rows); this._core.resize(columns, rows); } - public open(parent: HTMLElement): void { - this._core.open(parent); - } - public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void { - this._core.attachCustomKeyEventHandler(customKeyEventHandler); - } - public registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number { - this._checkProposedApi(); - return this._core.registerLinkMatcher(regex, handler, options); - } - public deregisterLinkMatcher(matcherId: number): void { - this._checkProposedApi(); - this._core.deregisterLinkMatcher(matcherId); - } - public registerLinkProvider(linkProvider: ILinkProvider): IDisposable { - this._checkProposedApi(); - return this._core.registerLinkProvider(linkProvider); - } - public registerCharacterJoiner(handler: (text: string) => [number, number][]): number { - this._checkProposedApi(); - return this._core.registerCharacterJoiner(handler); - } - public deregisterCharacterJoiner(joinerId: number): void { - this._checkProposedApi(); - this._core.deregisterCharacterJoiner(joinerId); - } public registerMarker(cursorYOffset: number): IMarker | undefined { this._checkProposedApi(); this._verifyIntegers(cursorYOffset); @@ -113,51 +70,9 @@ export class Terminal implements ITerminalApi { public addMarker(cursorYOffset: number): IMarker | undefined { return this.registerMarker(cursorYOffset); } - public hasSelection(): boolean { - return this._core.hasSelection(); - } - public select(column: number, row: number, length: number): void { - this._verifyIntegers(column, row, length); - this._core.select(column, row, length); - } - public getSelection(): string { - return this._core.getSelection(); - } - public getSelectionPosition(): ISelectionPosition | undefined { - return this._core.getSelectionPosition(); - } - public clearSelection(): void { - this._core.clearSelection(); - } - public selectAll(): void { - this._core.selectAll(); - } - public selectLines(start: number, end: number): void { - this._verifyIntegers(start, end); - this._core.selectLines(start, end); - } public dispose(): void { - this._addonManager.dispose(); this._core.dispose(); } - public scrollLines(amount: number): void { - this._verifyIntegers(amount); - this._core.scrollLines(amount); - } - public scrollPages(pageCount: number): void { - this._verifyIntegers(pageCount); - this._core.scrollPages(pageCount); - } - public scrollToTop(): void { - this._core.scrollToTop(); - } - public scrollToBottom(): void { - this._core.scrollToBottom(); - } - public scrollToLine(line: number): void { - this._verifyIntegers(line); - this._core.scrollToLine(line); - } public clear(): void { this._core.clear(); } @@ -171,13 +86,9 @@ export class Terminal implements ITerminalApi { this._core.write(data); this._core.write('\r\n', callback); } - public paste(data: string): void { - this._core.paste(data); - } public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string; public getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean; public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; - public getOption(key: 'fontWeight' | 'fontWeightBold'): FontWeight; public getOption(key: string): any; public getOption(key: any): any { return this._core.optionsService.getOption(key); @@ -189,25 +100,14 @@ export class Terminal implements ITerminalApi { public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void; public setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void; public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; - public setOption(key: 'theme', value: ITheme): void; public setOption(key: 'cols' | 'rows', value: number): void; public setOption(key: string, value: any): void; public setOption(key: any, value: any): void { this._core.optionsService.setOption(key, value); } - public refresh(start: number, end: number): void { - this._verifyIntegers(start, end); - this._core.refresh(start, end); - } public reset(): void { this._core.reset(); } - public loadAddon(addon: ITerminalAddon): void { - return this._addonManager.loadAddon(this, addon); - } - public static get strings(): ILocalizableStrings { - return Strings; - } private _verifyIntegers(...values: number[]): void { for (const value of values) { diff --git a/src/common/public/TerminalCore.ts b/src/common/public/TerminalCore.ts new file mode 100644 index 00000000..2aae1ee2 --- /dev/null +++ b/src/common/public/TerminalCore.ts @@ -0,0 +1,155 @@ +/** + * Copyright (c) 2014 The xterm.js authors. All rights reserved. + * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) + * @license MIT + * + * Originally forked from (with the author's permission): + * Fabrice Bellard's javascript vt100 for jslinux: + * http://bellard.org/jslinux/ + * Copyright (c) 2011 Fabrice Bellard + * The original design remains. The terminal itself + * has been extended to include xterm CSI codes, among + * other features. + * + * Terminal Emulation References: + * http://vt100.net/ + * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt + * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html + * http://invisible-island.net/vttest/ + * http://www.inwap.com/pdp10/ansicode.txt + * http://linux.die.net/man/4/console_codes + * http://linux.die.net/man/7/urxvt + */ + +import { ICoreTerminal, IDisposable, IMarker, ITerminalOptions } from 'common/Types'; +import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter'; +import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine'; +import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { CoreTerminal } from 'common/CoreTerminal'; +import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services'; +import { IFunctionIdentifier, IParams } from 'common/parser/Types'; + +export class Terminal extends CoreTerminal { + // TODO: We should remove options once components adopt optionsService + public get options(): IInitializedTerminalOptions { return this.optionsService.options; } + + + private _onCursorMove = new EventEmitter(); + public get onCursorMove(): IEvent { return this._onCursorMove.event; } + private _onTitleChange = new EventEmitter(); + public get onTitleChange(): IEvent { return this._onTitleChange.event; } + + private _onA11yCharEmitter = new EventEmitter(); + public get onA11yChar(): IEvent { return this._onA11yCharEmitter.event; } + private _onA11yTabEmitter = new EventEmitter(); + public get onA11yTab(): IEvent { return this._onA11yTabEmitter.event; } + + /** + * Creates a new `Terminal` object. + * + * @param options An object containing a set of options, the available options are: + * - `cursorBlink` (boolean): Whether the terminal cursor blinks + * - `cols` (number): The number of columns of the terminal (horizontal size) + * - `rows` (number): The number of rows of the terminal (vertical size) + * + * @public + * @class Xterm Xterm + * @alias module:xterm/src/xterm + */ + constructor( + options: ITerminalOptions = {} + ) { + super(options); + + this._setup(); + + // Setup InputHandler listeners + this.register(this._inputHandler.onRequestReset(() => this.reset())); + this.register(this._inputHandler.onRequestScroll((eraseAttr, isWrapped) => this.scroll(eraseAttr, isWrapped || undefined))); + this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove)); + this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange)); + this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter)); + this.register(forwardEvent(this._inputHandler.onA11yTab, this._onA11yTabEmitter)); + } + + public dispose(): void { + if (this._isDisposed) { + return; + } + super.dispose(); + this.write = () => { }; + } + + /** + * Convenience property to active buffer. + */ + public get buffer(): IBuffer { + return this.buffers.active; + } + + public get markers(): IMarker[] { + return this.buffer.markers; + } + + public addMarker(cursorYOffset: number): IMarker | undefined { + // Disallow markers on the alt buffer + if (this.buffer !== this.buffers.normal) { + return; + } + + return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); + } + + /** + * Resizes the terminal. + * + * @param x The number of columns to resize to. + * @param y The number of rows to resize to. + */ + public resize(x: number, y: number): void { + if (x === this.cols && y === this.rows) { + return; + } + + super.resize(x, y); + } + + /** + * Clear the entire buffer, making the prompt line the new first line. + */ + public clear(): void { + if (this.buffer.ybase === 0 && this.buffer.y === 0) { + // Don't clear if it's already clear + return; + } + this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)!); + this.buffer.lines.length = 1; + this.buffer.ydisp = 0; + this.buffer.ybase = 0; + this.buffer.y = 0; + for (let i = 1; i < this.rows; i++) { + this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA)); + } + this._onScroll.fire(this.buffer.ydisp); + } + + /** + * Reset terminal. + * Note: Calling this directly from JS is synchronous but does not clear + * input buffers and does not reset the parser, thus the terminal will + * continue to apply pending input data. + * If you need in band reset (synchronous with input data) consider + * using DECSTR (soft reset, CSI ! p) or RIS instead (hard reset, ESC c). + */ + public reset(): void { + /** + * Since _setup handles a full terminal creation, we have to carry forward + * a few things that should not reset. + */ + this.options.rows = this.rows; + this.options.cols = this.cols; + + this._setup(); + super.reset(); + } +} diff --git a/src/common/public/tsconfig.json b/src/common/public/tsconfig.json new file mode 100644 index 00000000..6e14ddf7 --- /dev/null +++ b/src/common/public/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig-library-base", + "compilerOptions": { + "lib": [ + "es2015", + "es2016.Array.Include" + ], + "outDir": "../../../xterm-core", // Temporary outdir to avoid collisions with 'xterm' + "types": [ + "../../../node_modules/@types/mocha", + "../../../node_modules/@types/node" + ], + "baseUrl": "../../", + "extendedDiagnostics": true + }, + "include": [ + "../**/*", + "../../../typings/xterm-core.d.ts", + "../../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' + ], +} diff --git a/src/common/public/types.ts b/src/common/public/types.ts new file mode 100644 index 00000000..1c20bd6d --- /dev/null +++ b/src/common/public/types.ts @@ -0,0 +1,31 @@ +import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { IEvent } from 'common/EventEmitter'; +import { IFunctionIdentifier, IParams } from 'common/parser/Types'; +import { ICoreTerminal, IDisposable, IMarker, ITerminalOptions } from 'common/Types'; + +export interface ITerminal extends ICoreTerminal { + rows: number; + cols: number; + buffer: IBuffer; + buffers: IBufferSet; + markers: IMarker[]; + // TODO: We should remove options once components adopt optionsService + options: ITerminalOptions; + + onCursorMove: IEvent; + onData: IEvent; + onBinary: IEvent; + onLineFeed: IEvent; + onResize: IEvent<{ cols: number, rows: number }>; + onTitleChange: IEvent; + resize(columns: number, rows: number): void; + addCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean): IDisposable; + addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean): IDisposable; + addEscHandler(id: IFunctionIdentifier, callback: () => boolean): IDisposable; + addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; + addMarker(cursorYOffset: number): IMarker | undefined; + dispose(): void; + clear(): void; + write(data: string | Uint8Array, callback?: () => void): void; + reset(): void; +} \ No newline at end of file From 2f88498ad5cb74756204f9a2f441b05136833d68 Mon Sep 17 00:00:00 2001 From: joyceerhl Date: Sun, 10 Jan 2021 22:32:36 -0800 Subject: [PATCH 03/42] Add index.js used to test xterm-core --- node-test/README.md | 10 ++++++++++ node-test/index.js | 12 ++++++++++++ node-test/package.json | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 node-test/README.md create mode 100644 node-test/index.js create mode 100644 node-test/package.json diff --git a/node-test/README.md b/node-test/README.md new file mode 100644 index 00000000..e4cf19b0 --- /dev/null +++ b/node-test/README.md @@ -0,0 +1,10 @@ +Cursory test that 'xterm-core' works: + +``` +# From root of this repo +npm run compile # Outputs to xterm-core +npx webpack --config core-webpack.config.js # Outputs to lib +cd node-test +npm link ../lib/ +node index.js +``` \ No newline at end of file diff --git a/node-test/index.js b/node-test/index.js new file mode 100644 index 00000000..19bff5dc --- /dev/null +++ b/node-test/index.js @@ -0,0 +1,12 @@ +import { createRequire } from 'module'; +const require = createRequire(import.meta.url); +const xterm = require('xterm-core'); + +console.log('Creating xterm-core terminal...'); +const terminal = new xterm.Terminal(); +console.log('Writing `ls` to terminal...') +terminal.write('ls', () => { + const bufferLine = terminal.buffer.normal.getLine(terminal.buffer.normal.cursorY); + const contents = bufferLine.translateToString(); + console.log(`Contents of terminal active buffer are: ${contents}`); // ls +}); diff --git a/node-test/package.json b/node-test/package.json new file mode 100644 index 00000000..93549623 --- /dev/null +++ b/node-test/package.json @@ -0,0 +1,11 @@ +{ + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "" +} From 91c7032aac38c6a3fa7d1d4a960efe5f8d7897f1 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:17:28 -0700 Subject: [PATCH 04/42] Use core terminal in common, remove duplicate classes --- src/common/public/Terminal.ts | 134 ++-------------------------------- 1 file changed, 6 insertions(+), 128 deletions(-) diff --git a/src/common/public/Terminal.ts b/src/common/public/Terminal.ts index 39ad5cd4..6b63ee1e 100644 --- a/src/common/public/Terminal.ts +++ b/src/common/public/Terminal.ts @@ -3,17 +3,15 @@ * @license MIT */ -import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, IUnicodeHandling, IUnicodeVersionProvider } from 'xterm-core'; -import { IBufferLine, ICellData } from 'common/Types'; -import { IBuffer } from 'common/buffer/Types'; -import { CellData } from 'common/buffer/CellData'; +import { IEvent } from 'common/EventEmitter'; +import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; +import { ParserApi } from 'common/public/ParserApi'; +import { UnicodeApi } from 'common/public/UnicodeApi'; +import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; import { Terminal as TerminalCore } from './TerminalCore'; -import { IEvent, EventEmitter } from 'common/EventEmitter'; -import { IParams } from 'common/parser/Types'; -import { ITerminal } from 'common/public/types'; export class Terminal implements ITerminalApi { - private _core: ITerminal; + private _core: TerminalCore; private _parser: IParser | undefined; private _buffer: BufferNamespaceApi | undefined; @@ -117,123 +115,3 @@ export class Terminal implements ITerminalApi { } } } - -class BufferApiView implements IBufferApi { - constructor( - private _buffer: IBuffer, - public readonly type: 'normal' | 'alternate' - ) { } - - public init(buffer: IBuffer): BufferApiView { - this._buffer = buffer; - return this; - } - - public get cursorY(): number { return this._buffer.y; } - public get cursorX(): number { return this._buffer.x; } - public get viewportY(): number { return this._buffer.ydisp; } - public get baseY(): number { return this._buffer.ybase; } - public get length(): number { return this._buffer.lines.length; } - public getLine(y: number): IBufferLineApi | undefined { - const line = this._buffer.lines.get(y); - if (!line) { - return undefined; - } - return new BufferLineApiView(line); - } - public getNullCell(): IBufferCellApi { return new CellData(); } -} - -class BufferNamespaceApi implements IBufferNamespaceApi { - private _normal: BufferApiView; - private _alternate: BufferApiView; - private _onBufferChange = new EventEmitter(); - public get onBufferChange(): IEvent { return this._onBufferChange.event; } - - constructor(private _core: ITerminal) { - this._normal = new BufferApiView(this._core.buffers.normal, 'normal'); - this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate'); - this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active)); - } - public get active(): IBufferApi { - if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; } - if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; } - throw new Error('Active buffer is neither normal nor alternate'); - } - public get normal(): IBufferApi { - return this._normal.init(this._core.buffers.normal); - } - public get alternate(): IBufferApi { - return this._alternate.init(this._core.buffers.alt); - } -} - -class BufferLineApiView implements IBufferLineApi { - constructor(private _line: IBufferLine) { } - - public get isWrapped(): boolean { return this._line.isWrapped; } - public get length(): number { return this._line.length; } - public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined { - if (x < 0 || x >= this._line.length) { - return undefined; - } - - if (cell) { - this._line.loadCell(x, cell); - return cell; - } - return this._line.loadCell(x, new CellData()); - } - public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string { - return this._line.translateToString(trimRight, startColumn, endColumn); - } -} - -class ParserApi implements IParser { - constructor(private _core: ITerminal) { } - - public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable { - return this._core.addCsiHandler(id, (params: IParams) => callback(params.toArray())); - } - public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable { - return this.registerCsiHandler(id, callback); - } - public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable { - return this._core.addDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray())); - } - public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable { - return this.registerDcsHandler(id, callback); - } - public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable { - return this._core.addEscHandler(id, handler); - } - public addEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable { - return this.registerEscHandler(id, handler); - } - public registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable { - return this._core.addOscHandler(ident, callback); - } - public addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable { - return this.registerOscHandler(ident, callback); - } -} - -class UnicodeApi implements IUnicodeHandling { - constructor(private _core: ITerminal) { } - - public register(provider: IUnicodeVersionProvider): void { - this._core.unicodeService.register(provider); - } - - public get versions(): string[] { - return this._core.unicodeService.versions; - } - - public get activeVersion(): string { - return this._core.unicodeService.activeVersion; - } - - public set activeVersion(version: string) { - this._core.unicodeService.activeVersion = version; - } -} From 625e17ee1c0da9636bcd73f10da8851b90f376ae Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:30:55 -0700 Subject: [PATCH 05/42] Fix some errors, move TerminalCore to common/ --- .../{public/TerminalCore.ts => Terminal.ts} | 17 +++++++++++------ src/common/public/Terminal.ts | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) rename src/common/{public/TerminalCore.ts => Terminal.ts} (90%) diff --git a/src/common/public/TerminalCore.ts b/src/common/Terminal.ts similarity index 90% rename from src/common/public/TerminalCore.ts rename to src/common/Terminal.ts index 2aae1ee2..4011adb9 100644 --- a/src/common/public/TerminalCore.ts +++ b/src/common/Terminal.ts @@ -21,19 +21,20 @@ * http://linux.die.net/man/7/urxvt */ -import { ICoreTerminal, IDisposable, IMarker, ITerminalOptions } from 'common/Types'; -import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter'; import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine'; -import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { IBuffer } from 'common/buffer/Types'; import { CoreTerminal } from 'common/CoreTerminal'; +import { EventEmitter, forwardEvent, IEvent } from 'common/EventEmitter'; import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services'; -import { IFunctionIdentifier, IParams } from 'common/parser/Types'; +import { IMarker, ITerminalOptions, ScrollSource } from 'common/Types'; export class Terminal extends CoreTerminal { // TODO: We should remove options once components adopt optionsService public get options(): IInitializedTerminalOptions { return this.optionsService.options; } + private _onBell = new EventEmitter(); + public get onBell (): IEvent { return this._onBell.event; } private _onCursorMove = new EventEmitter(); public get onCursorMove(): IEvent { return this._onCursorMove.event; } private _onTitleChange = new EventEmitter(); @@ -64,8 +65,8 @@ export class Terminal extends CoreTerminal { this._setup(); // Setup InputHandler listeners + this.register(this._inputHandler.onRequestBell(() => this.bell())); this.register(this._inputHandler.onRequestReset(() => this.reset())); - this.register(this._inputHandler.onRequestScroll((eraseAttr, isWrapped) => this.scroll(eraseAttr, isWrapped || undefined))); this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove)); this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange)); this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter)); @@ -100,6 +101,10 @@ export class Terminal extends CoreTerminal { return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); } + public bell(): void { + this._onBell.fire(); + } + /** * Resizes the terminal. * @@ -130,7 +135,7 @@ export class Terminal extends CoreTerminal { for (let i = 1; i < this.rows; i++) { this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA)); } - this._onScroll.fire(this.buffer.ydisp); + this._onScroll.fire({ position: this.buffer.ydisp, source: ScrollSource.TERMINAL }); } /** diff --git a/src/common/public/Terminal.ts b/src/common/public/Terminal.ts index 6b63ee1e..3d195b75 100644 --- a/src/common/public/Terminal.ts +++ b/src/common/public/Terminal.ts @@ -8,7 +8,7 @@ import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; -import { Terminal as TerminalCore } from './TerminalCore'; +import { Terminal as TerminalCore } from '../Terminal'; export class Terminal implements ITerminalApi { private _core: TerminalCore; From df17288c1e35983751345f8f6e05b399ba372a3a Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:40:13 -0700 Subject: [PATCH 06/42] Create headless project, fix compile --- .eslintrc.json | 1 + headless/headless/Terminal.d.ts | 28 + headless/headless/Terminal.d.ts.map | 1 + headless/headless/Terminal.js | 130 ++ headless/headless/Terminal.js.map | 1 + headless/headless/public/Terminal.d.ts | 48 + headless/headless/public/Terminal.d.ts.map | 1 + headless/headless/public/Terminal.js | 147 +++ headless/headless/public/Terminal.js.map | 1 + headless/headless/tsconfig.tsbuildinfo | 1120 +++++++++++++++++ headless/headless/types.d.ts | 32 + headless/headless/types.d.ts.map | 1 + headless/headless/types.js | 3 + headless/headless/types.js.map | 1 + src/common/public/tsconfig.json | 21 - src/{common => headless}/Terminal.ts | 0 .../public/types.ts => headless/Types.d.ts} | 2 +- src/{common => headless}/public/Terminal.ts | 2 +- src/headless/tsconfig.json | 27 + tsconfig.all.json | 1 + 20 files changed, 1545 insertions(+), 23 deletions(-) create mode 100644 headless/headless/Terminal.d.ts create mode 100644 headless/headless/Terminal.d.ts.map create mode 100644 headless/headless/Terminal.js create mode 100644 headless/headless/Terminal.js.map create mode 100644 headless/headless/public/Terminal.d.ts create mode 100644 headless/headless/public/Terminal.d.ts.map create mode 100644 headless/headless/public/Terminal.js create mode 100644 headless/headless/public/Terminal.js.map create mode 100644 headless/headless/tsconfig.tsbuildinfo create mode 100644 headless/headless/types.d.ts create mode 100644 headless/headless/types.d.ts.map create mode 100644 headless/headless/types.js create mode 100644 headless/headless/types.js.map delete mode 100644 src/common/public/tsconfig.json rename src/{common => headless}/Terminal.ts (100%) rename src/{common/public/types.ts => headless/Types.d.ts} (99%) rename src/{common => headless}/public/Terminal.ts (98%) create mode 100644 src/headless/tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json index 6031c195..427c7a16 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,6 +9,7 @@ "project": [ "src/browser/tsconfig.json", "src/common/tsconfig.json", + "src/headless/tsconfig.json", "test/api/tsconfig.json", "test/benchmark/tsconfig.json", "addons/xterm-addon-attach/src/tsconfig.json", diff --git a/headless/headless/Terminal.d.ts b/headless/headless/Terminal.d.ts new file mode 100644 index 00000000..7ab11fc7 --- /dev/null +++ b/headless/headless/Terminal.d.ts @@ -0,0 +1,28 @@ +import { IBuffer } from 'common/buffer/Types'; +import { CoreTerminal } from 'common/CoreTerminal'; +import { IEvent } from 'common/EventEmitter'; +import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services'; +import { IMarker, ITerminalOptions } from 'common/Types'; +export declare class Terminal extends CoreTerminal { + get options(): IInitializedTerminalOptions; + private _onBell; + get onBell(): IEvent; + private _onCursorMove; + get onCursorMove(): IEvent; + private _onTitleChange; + get onTitleChange(): IEvent; + private _onA11yCharEmitter; + get onA11yChar(): IEvent; + private _onA11yTabEmitter; + get onA11yTab(): IEvent; + constructor(options?: ITerminalOptions); + dispose(): void; + get buffer(): IBuffer; + get markers(): IMarker[]; + addMarker(cursorYOffset: number): IMarker | undefined; + bell(): void; + resize(x: number, y: number): void; + clear(): void; + reset(): void; +} +//# sourceMappingURL=Terminal.d.ts.map \ No newline at end of file diff --git a/headless/headless/Terminal.d.ts.map b/headless/headless/Terminal.d.ts.map new file mode 100644 index 00000000..f5020f83 --- /dev/null +++ b/headless/headless/Terminal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../src/headless/Terminal.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAA8B,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,gBAAgB,IAAI,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,cAAc,CAAC;AAEvE,qBAAa,QAAS,SAAQ,YAAY;IAExC,IAAW,OAAO,IAAI,2BAA2B,CAAwC;IAGzF,OAAO,CAAC,OAAO,CAA6B;IAC5C,IAAW,MAAM,IAAK,MAAM,CAAC,IAAI,CAAC,CAA+B;IACjE,OAAO,CAAC,aAAa,CAA4B;IACjD,IAAW,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,CAAqC;IAC5E,OAAO,CAAC,cAAc,CAA8B;IACpD,IAAW,aAAa,IAAI,MAAM,CAAC,MAAM,CAAC,CAAsC;IAEhF,OAAO,CAAC,kBAAkB,CAA8B;IACxD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,CAA0C;IACjF,OAAO,CAAC,iBAAiB,CAA8B;IACvD,IAAW,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,CAAyC;gBAe7E,OAAO,GAAE,gBAAqB;IAezB,OAAO,IAAI,IAAI;IAWtB,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,OAAO,IAAI,OAAO,EAAE,CAE9B;IAEM,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IASrD,IAAI,IAAI,IAAI;IAUZ,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAWlC,KAAK,IAAI,IAAI;IAwBb,KAAK,IAAI,IAAI;CAWrB"} \ No newline at end of file diff --git a/headless/headless/Terminal.js b/headless/headless/Terminal.js new file mode 100644 index 00000000..66f4d364 --- /dev/null +++ b/headless/headless/Terminal.js @@ -0,0 +1,130 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Terminal = void 0; +var BufferLine_1 = require("common/buffer/BufferLine"); +var CoreTerminal_1 = require("common/CoreTerminal"); +var EventEmitter_1 = require("common/EventEmitter"); +var Terminal = (function (_super) { + __extends(Terminal, _super); + function Terminal(options) { + if (options === void 0) { options = {}; } + var _this = _super.call(this, options) || this; + _this._onBell = new EventEmitter_1.EventEmitter(); + _this._onCursorMove = new EventEmitter_1.EventEmitter(); + _this._onTitleChange = new EventEmitter_1.EventEmitter(); + _this._onA11yCharEmitter = new EventEmitter_1.EventEmitter(); + _this._onA11yTabEmitter = new EventEmitter_1.EventEmitter(); + _this._setup(); + _this.register(_this._inputHandler.onRequestBell(function () { return _this.bell(); })); + _this.register(_this._inputHandler.onRequestReset(function () { return _this.reset(); })); + _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onCursorMove, _this._onCursorMove)); + _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onTitleChange, _this._onTitleChange)); + _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onA11yChar, _this._onA11yCharEmitter)); + _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onA11yTab, _this._onA11yTabEmitter)); + return _this; + } + Object.defineProperty(Terminal.prototype, "options", { + get: function () { return this.optionsService.options; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onBell", { + get: function () { return this._onBell.event; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onCursorMove", { + get: function () { return this._onCursorMove.event; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onTitleChange", { + get: function () { return this._onTitleChange.event; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onA11yChar", { + get: function () { return this._onA11yCharEmitter.event; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onA11yTab", { + get: function () { return this._onA11yTabEmitter.event; }, + enumerable: false, + configurable: true + }); + Terminal.prototype.dispose = function () { + if (this._isDisposed) { + return; + } + _super.prototype.dispose.call(this); + this.write = function () { }; + }; + Object.defineProperty(Terminal.prototype, "buffer", { + get: function () { + return this.buffers.active; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "markers", { + get: function () { + return this.buffer.markers; + }, + enumerable: false, + configurable: true + }); + Terminal.prototype.addMarker = function (cursorYOffset) { + if (this.buffer !== this.buffers.normal) { + return; + } + return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); + }; + Terminal.prototype.bell = function () { + this._onBell.fire(); + }; + Terminal.prototype.resize = function (x, y) { + if (x === this.cols && y === this.rows) { + return; + } + _super.prototype.resize.call(this, x, y); + }; + Terminal.prototype.clear = function () { + if (this.buffer.ybase === 0 && this.buffer.y === 0) { + return; + } + this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)); + this.buffer.lines.length = 1; + this.buffer.ydisp = 0; + this.buffer.ybase = 0; + this.buffer.y = 0; + for (var i = 1; i < this.rows; i++) { + this.buffer.lines.push(this.buffer.getBlankLine(BufferLine_1.DEFAULT_ATTR_DATA)); + } + this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }); + }; + Terminal.prototype.reset = function () { + this.options.rows = this.rows; + this.options.cols = this.cols; + this._setup(); + _super.prototype.reset.call(this); + }; + return Terminal; +}(CoreTerminal_1.CoreTerminal)); +exports.Terminal = Terminal; +//# sourceMappingURL=Terminal.js.map \ No newline at end of file diff --git a/headless/headless/Terminal.js.map b/headless/headless/Terminal.js.map new file mode 100644 index 00000000..ba7e26de --- /dev/null +++ b/headless/headless/Terminal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../src/headless/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/public/Terminal.d.ts b/headless/headless/public/Terminal.d.ts new file mode 100644 index 00000000..669fff57 --- /dev/null +++ b/headless/headless/public/Terminal.d.ts @@ -0,0 +1,48 @@ +import { IEvent } from 'common/EventEmitter'; +import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; +export declare class Terminal implements ITerminalApi { + private _core; + private _parser; + private _buffer; + constructor(options?: ITerminalOptions); + private _checkProposedApi; + get onCursorMove(): IEvent; + get onLineFeed(): IEvent; + get onData(): IEvent; + get onBinary(): IEvent; + get onTitleChange(): IEvent; + get onResize(): IEvent<{ + cols: number; + rows: number; + }>; + get parser(): IParser; + get unicode(): IUnicodeHandling; + get rows(): number; + get cols(): number; + get buffer(): IBufferNamespaceApi; + get markers(): ReadonlyArray; + resize(columns: number, rows: number): void; + registerMarker(cursorYOffset: number): IMarker | undefined; + addMarker(cursorYOffset: number): IMarker | undefined; + dispose(): void; + clear(): void; + write(data: string | Uint8Array, callback?: () => void): void; + writeUtf8(data: Uint8Array, callback?: () => void): void; + writeln(data: string | Uint8Array, callback?: () => void): void; + getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string; + getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean; + getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; + getOption(key: string): any; + setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void; + setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void; + setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void; + setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void; + setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void; + setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void; + setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; + setOption(key: 'cols' | 'rows', value: number): void; + setOption(key: string, value: any): void; + reset(): void; + private _verifyIntegers; +} +//# sourceMappingURL=Terminal.d.ts.map \ No newline at end of file diff --git a/headless/headless/public/Terminal.d.ts.map b/headless/headless/public/Terminal.d.ts.map new file mode 100644 index 00000000..b8fda933 --- /dev/null +++ b/headless/headless/public/Terminal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../../src/headless/public/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/public/Terminal.js b/headless/headless/public/Terminal.js new file mode 100644 index 00000000..1718c3b6 --- /dev/null +++ b/headless/headless/public/Terminal.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Terminal = void 0; +var BufferNamespaceApi_1 = require("common/public/BufferNamespaceApi"); +var ParserApi_1 = require("common/public/ParserApi"); +var UnicodeApi_1 = require("common/public/UnicodeApi"); +var Terminal_1 = require("headless/Terminal"); +var Terminal = (function () { + function Terminal(options) { + this._core = new Terminal_1.Terminal(options); + } + Terminal.prototype._checkProposedApi = function () { + if (!this._core.optionsService.options.allowProposedApi) { + throw new Error('You must set the allowProposedApi option to true to use proposed API'); + } + }; + Object.defineProperty(Terminal.prototype, "onCursorMove", { + get: function () { return this._core.onCursorMove; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onLineFeed", { + get: function () { return this._core.onLineFeed; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onData", { + get: function () { return this._core.onData; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onBinary", { + get: function () { return this._core.onBinary; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onTitleChange", { + get: function () { return this._core.onTitleChange; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "onResize", { + get: function () { return this._core.onResize; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "parser", { + get: function () { + this._checkProposedApi(); + if (!this._parser) { + this._parser = new ParserApi_1.ParserApi(this._core); + } + return this._parser; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "unicode", { + get: function () { + this._checkProposedApi(); + return new UnicodeApi_1.UnicodeApi(this._core); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "rows", { + get: function () { return this._core.rows; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "cols", { + get: function () { return this._core.cols; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "buffer", { + get: function () { + this._checkProposedApi(); + if (!this._buffer) { + this._buffer = new BufferNamespaceApi_1.BufferNamespaceApi(this._core); + } + return this._buffer; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Terminal.prototype, "markers", { + get: function () { + this._checkProposedApi(); + return this._core.markers; + }, + enumerable: false, + configurable: true + }); + Terminal.prototype.resize = function (columns, rows) { + this._verifyIntegers(columns, rows); + this._core.resize(columns, rows); + }; + Terminal.prototype.registerMarker = function (cursorYOffset) { + this._checkProposedApi(); + this._verifyIntegers(cursorYOffset); + return this._core.addMarker(cursorYOffset); + }; + Terminal.prototype.addMarker = function (cursorYOffset) { + return this.registerMarker(cursorYOffset); + }; + Terminal.prototype.dispose = function () { + this._core.dispose(); + }; + Terminal.prototype.clear = function () { + this._core.clear(); + }; + Terminal.prototype.write = function (data, callback) { + this._core.write(data, callback); + }; + Terminal.prototype.writeUtf8 = function (data, callback) { + this._core.write(data, callback); + }; + Terminal.prototype.writeln = function (data, callback) { + this._core.write(data); + this._core.write('\r\n', callback); + }; + Terminal.prototype.getOption = function (key) { + return this._core.optionsService.getOption(key); + }; + Terminal.prototype.setOption = function (key, value) { + this._core.optionsService.setOption(key, value); + }; + Terminal.prototype.reset = function () { + this._core.reset(); + }; + Terminal.prototype._verifyIntegers = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + for (var _a = 0, values_1 = values; _a < values_1.length; _a++) { + var value = values_1[_a]; + if (value === Infinity || isNaN(value) || value % 1 !== 0) { + throw new Error('This API only accepts integers'); + } + } + }; + return Terminal; +}()); +exports.Terminal = Terminal; +//# sourceMappingURL=Terminal.js.map \ No newline at end of file diff --git a/headless/headless/public/Terminal.js.map b/headless/headless/public/Terminal.js.map new file mode 100644 index 00000000..6e27bbc7 --- /dev/null +++ b/headless/headless/public/Terminal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/headless/public/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/tsconfig.tsbuildinfo b/headless/headless/tsconfig.tsbuildinfo new file mode 100644 index 00000000..7307c747 --- /dev/null +++ b/headless/headless/tsconfig.tsbuildinfo @@ -0,0 +1,1120 @@ +{ + "program": { + "fileInfos": { + "../../node_modules/typescript/lib/lib.es5.d.ts": { + "version": "b3584bc5798ed422ce2516df360ffa9cf2d80b5eae852867db9ba3743145f895", + "signature": "b3584bc5798ed422ce2516df360ffa9cf2d80b5eae852867db9ba3743145f895", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.d.ts": { + "version": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", + "signature": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", + "affectsGlobalScope": false + }, + "../../node_modules/typescript/lib/lib.es2016.d.ts": { + "version": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", + "signature": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", + "affectsGlobalScope": false + }, + "../../node_modules/typescript/lib/lib.es2017.d.ts": { + "version": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", + "signature": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", + "affectsGlobalScope": false + }, + "../../node_modules/typescript/lib/lib.es2018.d.ts": { + "version": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", + "signature": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", + "affectsGlobalScope": false + }, + "../../node_modules/typescript/lib/lib.dom.d.ts": { + "version": "feeeb1dd8a80fb76be42b0426e8f3ffa9bdef3c2f3c12c147e7660b1c5ba8b3b", + "signature": "feeeb1dd8a80fb76be42b0426e8f3ffa9bdef3c2f3c12c147e7660b1c5ba8b3b", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.core.d.ts": { + "version": "46ee15e9fefa913333b61eaf6b18885900b139867d89832a515059b62cf16a17", + "signature": "46ee15e9fefa913333b61eaf6b18885900b139867d89832a515059b62cf16a17", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.collection.d.ts": { + "version": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", + "signature": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.generator.d.ts": { + "version": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", + "signature": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.iterable.d.ts": { + "version": "8b2a5df1ce95f78f6b74f1a555ccdb6baab0486b42d8345e0871dd82811f9b9a", + "signature": "8b2a5df1ce95f78f6b74f1a555ccdb6baab0486b42d8345e0871dd82811f9b9a", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.promise.d.ts": { + "version": "2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c", + "signature": "2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.proxy.d.ts": { + "version": "810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357", + "signature": "810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.reflect.d.ts": { + "version": "62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6", + "signature": "62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.symbol.d.ts": { + "version": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", + "signature": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { + "version": "9d122b7e8c1a5c72506eea50c0973cba55b92b5532d5cafa8a6ce2c547d57551", + "signature": "9d122b7e8c1a5c72506eea50c0973cba55b92b5532d5cafa8a6ce2c547d57551", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2016.array.include.d.ts": { + "version": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", + "signature": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2017.object.d.ts": { + "version": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", + "signature": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { + "version": "7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98", + "signature": "7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2017.string.d.ts": { + "version": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", + "signature": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2017.intl.d.ts": { + "version": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", + "signature": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { + "version": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", + "signature": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts": { + "version": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", + "signature": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": { + "version": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", + "signature": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2018.intl.d.ts": { + "version": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", + "signature": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2018.promise.d.ts": { + "version": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", + "signature": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2018.regexp.d.ts": { + "version": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", + "signature": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.es2020.bigint.d.ts": { + "version": "7b5a10e3c897fabece5a51aa85b4111727d7adb53c2734b5d37230ff96802a09", + "signature": "7b5a10e3c897fabece5a51aa85b4111727d7adb53c2734b5d37230ff96802a09", + "affectsGlobalScope": true + }, + "../../node_modules/typescript/lib/lib.esnext.intl.d.ts": { + "version": "506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e", + "signature": "506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e", + "affectsGlobalScope": true + }, + "../../out/common/eventemitter.d.ts": { + "version": "5b03a7f7f7f551e3fe0e92da13d2e17e7ad7ee19c41d0637f4edbc120bc06f66", + "signature": "5b03a7f7f7f551e3fe0e92da13d2e17e7ad7ee19c41d0637f4edbc120bc06f66", + "affectsGlobalScope": false + }, + "../../out/common/circularlist.d.ts": { + "version": "f96222a7fe4af80068de748cd4bd0b247359b303c72cc827e887eaf6ef9fb758", + "signature": "f96222a7fe4af80068de748cd4bd0b247359b303c72cc827e887eaf6ef9fb758", + "affectsGlobalScope": false + }, + "../../out/common/parser/constants.d.ts": { + "version": "ae42446973a3c189ecac84723e74828ee292f9392935db874cb27ee19ca89093", + "signature": "ae42446973a3c189ecac84723e74828ee292f9392935db874cb27ee19ca89093", + "affectsGlobalScope": false + }, + "../../src/common/parser/types.d.ts": { + "version": "55b56377b6fa8b93856027f20ebaccd8e0c77d4327e45e45b5e2041cf94011cc", + "signature": "55b56377b6fa8b93856027f20ebaccd8e0c77d4327e45e45b5e2041cf94011cc", + "affectsGlobalScope": false + }, + "../../src/common/buffer/types.d.ts": { + "version": "5e2f59fc5cb1b39a2e163bafe30139a33dac4033edcb9b1b831d542abb7f7bae", + "signature": "5e2f59fc5cb1b39a2e163bafe30139a33dac4033edcb9b1b831d542abb7f7bae", + "affectsGlobalScope": false + }, + "../../out/common/services/services.d.ts": { + "version": "4672a4d6d71a25b4592922ecd70094e932348a031d39acc4cef027ea9b62cba0", + "signature": "4672a4d6d71a25b4592922ecd70094e932348a031d39acc4cef027ea9b62cba0", + "affectsGlobalScope": false + }, + "../../src/common/types.d.ts": { + "version": "d7d8eb9c47232c80348f2fc6c8eb7d3acb329b6d8fdcf1f1c38d6e5099f8370b", + "signature": "d7d8eb9c47232c80348f2fc6c8eb7d3acb329b6d8fdcf1f1c38d6e5099f8370b", + "affectsGlobalScope": false + }, + "../../out/common/buffer/constants.d.ts": { + "version": "ff74cff1b7fe399447fd661d0c68586e7b991d11d044af133963c04bde38a852", + "signature": "ff74cff1b7fe399447fd661d0c68586e7b991d11d044af133963c04bde38a852", + "affectsGlobalScope": false + }, + "../../out/common/buffer/attributedata.d.ts": { + "version": "421bb313e7b328ba640853d13b584fe7815b818bd02584d020a41b7a7120d262", + "signature": "421bb313e7b328ba640853d13b584fe7815b818bd02584d020a41b7a7120d262", + "affectsGlobalScope": false + }, + "../../out/common/buffer/bufferline.d.ts": { + "version": "baaa0fc61cb33a67caa0abb986740700be9313c6866ed78c17193e87ca7057a1", + "signature": "baaa0fc61cb33a67caa0abb986740700be9313c6866ed78c17193e87ca7057a1", + "affectsGlobalScope": false + }, + "../../out/common/lifecycle.d.ts": { + "version": "0ba457ac19650eb9dffb8216ca42947899613be5aee16f3809fe39187c30423e", + "signature": "0ba457ac19650eb9dffb8216ca42947899613be5aee16f3809fe39187c30423e", + "affectsGlobalScope": false + }, + "../../out/common/inputhandler.d.ts": { + "version": "542507ad71abebbfe8b5da8758e1aa47bfce3acd0da245f10885cab9934b71d6", + "signature": "542507ad71abebbfe8b5da8758e1aa47bfce3acd0da245f10885cab9934b71d6", + "affectsGlobalScope": false + }, + "../../out/common/coreterminal.d.ts": { + "version": "ab615cd4d0ef6f17d26eef27cdf5beec0e081e59b5eefb09ede878c2cabb4c15", + "signature": "ab615cd4d0ef6f17d26eef27cdf5beec0e081e59b5eefb09ede878c2cabb4c15", + "affectsGlobalScope": false + }, + "../../src/headless/terminal.ts": { + "version": "59209d1535dcfbe8bac847ccf13e829a9ea692ce58fdcb3ee3605791ae60b564", + "signature": "5311ffa92a616a0729010de20af2272185a8b65b51ac26a496326b3b32aad8cc", + "affectsGlobalScope": false + }, + "../../src/headless/types.d.ts": { + "version": "d51941b70feb73ac171f24e34f11de9be17d0c4f224da1a6ed39fe8c31ba6695", + "signature": "d51941b70feb73ac171f24e34f11de9be17d0c4f224da1a6ed39fe8c31ba6695", + "affectsGlobalScope": false + }, + "../../out/common/public/buffernamespaceapi.d.ts": { + "version": "1f8e93ce424bd436ad641d8313d849af586a3779adbfd870e1cfee72a212ae57", + "signature": "1f8e93ce424bd436ad641d8313d849af586a3779adbfd870e1cfee72a212ae57", + "affectsGlobalScope": false + }, + "../../out/common/public/parserapi.d.ts": { + "version": "7c0d242565ad3b41ef8666e46fbd88aec222d2e9b2a343ac315b00373401ffc2", + "signature": "7c0d242565ad3b41ef8666e46fbd88aec222d2e9b2a343ac315b00373401ffc2", + "affectsGlobalScope": false + }, + "../../out/common/public/unicodeapi.d.ts": { + "version": "d77b28e85c1bbc95897707b719c4797ac94f5bf76572c81baae195787133826c", + "signature": "d77b28e85c1bbc95897707b719c4797ac94f5bf76572c81baae195787133826c", + "affectsGlobalScope": false + }, + "../../src/headless/public/terminal.ts": { + "version": "fce93b9408e0c088a1c6802aff2cf8cc46ac0feddc59f26b5a3241d0f03c82db", + "signature": "503924e7f37322f587ebce5459da9c47860c843c0d30d6d09b6ba25d5d169ac7", + "affectsGlobalScope": false + }, + "../../typings/xterm.d.ts": { + "version": "d5256f76893350e4897436490570d291be7a2a005d44e3fa221f1a19804b8c5e", + "signature": "d5256f76893350e4897436490570d291be7a2a005d44e3fa221f1a19804b8c5e", + "affectsGlobalScope": false + }, + "../../typings/xterm-core.d.ts": { + "version": "675fd5779b700c3e864a36a14db728d91027632f90e60c7bfd440b5db61e174d", + "signature": "675fd5779b700c3e864a36a14db728d91027632f90e60c7bfd440b5db61e174d", + "affectsGlobalScope": false + }, + "../../node_modules/@types/mocha/index.d.ts": { + "version": "0359800d3b440f8515001431cde1500944e156040577425eb3f7b80af0846612", + "signature": "0359800d3b440f8515001431cde1500944e156040577425eb3f7b80af0846612", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/globals.d.ts": { + "version": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", + "signature": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/async_hooks.d.ts": { + "version": "c9e8a340da877b05a52525554aa255b3f44958c7f6748ebf5cbe0bfbe6766878", + "signature": "c9e8a340da877b05a52525554aa255b3f44958c7f6748ebf5cbe0bfbe6766878", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/buffer.d.ts": { + "version": "a473cf45c3d9809518f8af913312139d9f4db6887dc554e0d06d0f4e52722e6b", + "signature": "a473cf45c3d9809518f8af913312139d9f4db6887dc554e0d06d0f4e52722e6b", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/child_process.d.ts": { + "version": "a668dfae917097b30fc29bbebeeb869cee22529f2aa9976cea03c7e834a1b841", + "signature": "a668dfae917097b30fc29bbebeeb869cee22529f2aa9976cea03c7e834a1b841", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/cluster.d.ts": { + "version": "04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef", + "signature": "04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/console.d.ts": { + "version": "c8155caf28fc7b0a564156a5df28ad8a844a3bd32d331d148d8f3ce88025c870", + "signature": "c8155caf28fc7b0a564156a5df28ad8a844a3bd32d331d148d8f3ce88025c870", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/constants.d.ts": { + "version": "45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491", + "signature": "45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/crypto.d.ts": { + "version": "0084b54e281a37c75079f92ca20603d5731de063e7a425852b2907de4dd19932", + "signature": "0084b54e281a37c75079f92ca20603d5731de063e7a425852b2907de4dd19932", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/dgram.d.ts": { + "version": "797a9d37eb1f76143311c3f0a186ce5c0d8735e94c0ca08ff8712a876c9b4f9e", + "signature": "797a9d37eb1f76143311c3f0a186ce5c0d8735e94c0ca08ff8712a876c9b4f9e", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/dns.d.ts": { + "version": "bc31e01146eec89eb870b9ad8c55d759bcbc8989a894e6f0f81f832e0d10eb04", + "signature": "bc31e01146eec89eb870b9ad8c55d759bcbc8989a894e6f0f81f832e0d10eb04", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/domain.d.ts": { + "version": "2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5", + "signature": "2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/events.d.ts": { + "version": "153d835dc32985120790e10102834b0a5bd979bb5e42bfbb33c0ff6260cf03ce", + "signature": "153d835dc32985120790e10102834b0a5bd979bb5e42bfbb33c0ff6260cf03ce", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/fs.d.ts": { + "version": "a44c87a409b60f211a240341905d818f5f173420dcf7f989ee6c8a1a3d812ae9", + "signature": "a44c87a409b60f211a240341905d818f5f173420dcf7f989ee6c8a1a3d812ae9", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/fs/promises.d.ts": { + "version": "bdaf554ae2d9d09e2a42f58a29ef7f80e5b5c1d7b96bfb717243dc91a477216e", + "signature": "bdaf554ae2d9d09e2a42f58a29ef7f80e5b5c1d7b96bfb717243dc91a477216e", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/http.d.ts": { + "version": "dce8672a79c7221c10a355b905940ab57505bc480a72a5da33ba24cbf82bb75c", + "signature": "dce8672a79c7221c10a355b905940ab57505bc480a72a5da33ba24cbf82bb75c", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/http2.d.ts": { + "version": "321ea733ae7f611077a2d7b4bc378ac4a6b7e365e1a51c71a7e5b2818e1e310a", + "signature": "321ea733ae7f611077a2d7b4bc378ac4a6b7e365e1a51c71a7e5b2818e1e310a", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/https.d.ts": { + "version": "13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452", + "signature": "13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/inspector.d.ts": { + "version": "42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8", + "signature": "42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/module.d.ts": { + "version": "0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d", + "signature": "0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/net.d.ts": { + "version": "40b957b502b40dd490ee334aed47a30636f8d14a0267d1b6c088c2be1dcf2757", + "signature": "40b957b502b40dd490ee334aed47a30636f8d14a0267d1b6c088c2be1dcf2757", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/os.d.ts": { + "version": "69640cc2e76dad52daeb9914e6b70c5c9a5591a3a65190a2d3ea432cf0015e16", + "signature": "69640cc2e76dad52daeb9914e6b70c5c9a5591a3a65190a2d3ea432cf0015e16", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/path.d.ts": { + "version": "21e64a125f65dff99cc3ed366c96e922b90daed343eb52ecdace5f220401dcda", + "signature": "21e64a125f65dff99cc3ed366c96e922b90daed343eb52ecdace5f220401dcda", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/perf_hooks.d.ts": { + "version": "4982d94cb6427263c8839d8d6324a8bbe129e931deb61a7380f8fad17ba2cfc0", + "signature": "4982d94cb6427263c8839d8d6324a8bbe129e931deb61a7380f8fad17ba2cfc0", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/process.d.ts": { + "version": "b0b00cf2e8107ab671243a73d2fbd6296a853bebe3fcfaaca293f65aaa245eaf", + "signature": "b0b00cf2e8107ab671243a73d2fbd6296a853bebe3fcfaaca293f65aaa245eaf", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/punycode.d.ts": { + "version": "7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6", + "signature": "7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/querystring.d.ts": { + "version": "992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58", + "signature": "992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/readline.d.ts": { + "version": "3b790d08129aca55fd5ae1672d1d26594147ac0d5f2eedc30c7575eb18daef7e", + "signature": "3b790d08129aca55fd5ae1672d1d26594147ac0d5f2eedc30c7575eb18daef7e", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/repl.d.ts": { + "version": "64535caf208a02420d2d04eb2029269efedd11eb8597ada0d5e6f3d54ec663ae", + "signature": "64535caf208a02420d2d04eb2029269efedd11eb8597ada0d5e6f3d54ec663ae", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/stream.d.ts": { + "version": "e7b5a3f40f19d9eea71890c70dfb37ac5dd82cbffe5f95bc8f23c536455732d0", + "signature": "e7b5a3f40f19d9eea71890c70dfb37ac5dd82cbffe5f95bc8f23c536455732d0", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/string_decoder.d.ts": { + "version": "4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50", + "signature": "4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/timers.d.ts": { + "version": "0953427f9c2498f71dd912fdd8a81b19cf6925de3e1ad67ab9a77b9a0f79bf0b", + "signature": "0953427f9c2498f71dd912fdd8a81b19cf6925de3e1ad67ab9a77b9a0f79bf0b", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/tls.d.ts": { + "version": "f89a6d56f0267f6e73c707f8a89d2f38e9928e10bfa505f39a4f4bf954093aee", + "signature": "f89a6d56f0267f6e73c707f8a89d2f38e9928e10bfa505f39a4f4bf954093aee", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/trace_events.d.ts": { + "version": "7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4", + "signature": "7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/tty.d.ts": { + "version": "9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5", + "signature": "9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/url.d.ts": { + "version": "dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9", + "signature": "dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/util.d.ts": { + "version": "e649840284bab8c4d09cadc125cd7fbde7529690cc1a0881872b6a9cd202819b", + "signature": "e649840284bab8c4d09cadc125cd7fbde7529690cc1a0881872b6a9cd202819b", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/v8.d.ts": { + "version": "a364b4a8a015ae377052fa4fac94204d79a69d879567f444c7ceff1b7a18482d", + "signature": "a364b4a8a015ae377052fa4fac94204d79a69d879567f444c7ceff1b7a18482d", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/vm.d.ts": { + "version": "1aa7dbace2b7b2ef60897dcd4f66252ee6ba85e594ded8918c9acdcecda1896c", + "signature": "1aa7dbace2b7b2ef60897dcd4f66252ee6ba85e594ded8918c9acdcecda1896c", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/worker_threads.d.ts": { + "version": "6c63cb179eda2be5ab45dc146fa4151bec8ce4781986935fe40adfc69cbbf214", + "signature": "6c63cb179eda2be5ab45dc146fa4151bec8ce4781986935fe40adfc69cbbf214", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/zlib.d.ts": { + "version": "4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875", + "signature": "4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/globals.global.d.ts": { + "version": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", + "signature": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", + "affectsGlobalScope": true + }, + "../../node_modules/@types/node/wasi.d.ts": { + "version": "4e0a4d84b15692ea8669fe4f3d05a4f204567906b1347da7a58b75f45bae48d3", + "signature": "4e0a4d84b15692ea8669fe4f3d05a4f204567906b1347da7a58b75f45bae48d3", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/ts3.6/base.d.ts": { + "version": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", + "signature": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/assert.d.ts": { + "version": "b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76", + "signature": "b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/base.d.ts": { + "version": "e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b", + "signature": "e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b", + "affectsGlobalScope": false + }, + "../../node_modules/@types/node/index.d.ts": { + "version": "6c137dee82a61e14a1eb6a0ba56925b66fd83abf15acf72fe59a10b15e80e319", + "signature": "6c137dee82a61e14a1eb6a0ba56925b66fd83abf15acf72fe59a10b15e80e319", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "lib": [ + "lib.es2015.d.ts", + "lib.es2016.array.include.d.ts" + ], + "rootDir": "../../src", + "sourceMap": true, + "removeComments": true, + "pretty": true, + "incremental": true, + "experimentalDecorators": true, + "composite": true, + "strict": true, + "declarationMap": true, + "outDir": "..", + "types": [ + "../../node_modules/@types/mocha", + "../../node_modules/@types/node" + ], + "baseUrl": "../../src", + "extendedDiagnostics": true, + "paths": { + "common/*": [ + "./common/*" + ] + }, + "pathsBasePath": "D:/GitHub/Tyriar/xterm.js/src/headless", + "watch": true, + "preserveWatchOutput": true, + "configFilePath": "../../src/headless/tsconfig.json" + }, + "referencedMap": { + "../../node_modules/@types/node/base.d.ts": [ + "../../node_modules/@types/node/assert.d.ts", + "../../node_modules/@types/node/ts3.6/base.d.ts" + ], + "../../node_modules/@types/node/child_process.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/cluster.d.ts": [ + "../../node_modules/@types/node/child_process.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/console.d.ts": [ + "../../node_modules/@types/node/util.d.ts" + ], + "../../node_modules/@types/node/constants.d.ts": [ + "../../node_modules/@types/node/crypto.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/os.d.ts" + ], + "../../node_modules/@types/node/crypto.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/dgram.d.ts": [ + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/domain.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/events.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/fs.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/fs/promises.d.ts": [ + "../../node_modules/@types/node/fs.d.ts" + ], + "../../node_modules/@types/node/http.d.ts": [ + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/http2.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/https.d.ts": [ + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/index.d.ts": [ + "../../node_modules/@types/node/base.d.ts" + ], + "../../node_modules/@types/node/inspector.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/module.d.ts": [ + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/net.d.ts": [ + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/perf_hooks.d.ts": [ + "../../node_modules/@types/node/async_hooks.d.ts" + ], + "../../node_modules/@types/node/process.d.ts": [ + "../../node_modules/@types/node/tty.d.ts" + ], + "../../node_modules/@types/node/readline.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/repl.d.ts": [ + "../../node_modules/@types/node/readline.d.ts", + "../../node_modules/@types/node/util.d.ts", + "../../node_modules/@types/node/vm.d.ts" + ], + "../../node_modules/@types/node/stream.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/tls.d.ts": [ + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/ts3.6/base.d.ts": [ + "../../node_modules/@types/node/async_hooks.d.ts", + "../../node_modules/@types/node/buffer.d.ts", + "../../node_modules/@types/node/child_process.d.ts", + "../../node_modules/@types/node/cluster.d.ts", + "../../node_modules/@types/node/console.d.ts", + "../../node_modules/@types/node/constants.d.ts", + "../../node_modules/@types/node/crypto.d.ts", + "../../node_modules/@types/node/dgram.d.ts", + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/domain.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/globals.d.ts", + "../../node_modules/@types/node/globals.global.d.ts", + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/http2.d.ts", + "../../node_modules/@types/node/https.d.ts", + "../../node_modules/@types/node/inspector.d.ts", + "../../node_modules/@types/node/module.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/os.d.ts", + "../../node_modules/@types/node/path.d.ts", + "../../node_modules/@types/node/perf_hooks.d.ts", + "../../node_modules/@types/node/process.d.ts", + "../../node_modules/@types/node/punycode.d.ts", + "../../node_modules/@types/node/querystring.d.ts", + "../../node_modules/@types/node/readline.d.ts", + "../../node_modules/@types/node/repl.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/string_decoder.d.ts", + "../../node_modules/@types/node/timers.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/trace_events.d.ts", + "../../node_modules/@types/node/tty.d.ts", + "../../node_modules/@types/node/url.d.ts", + "../../node_modules/@types/node/util.d.ts", + "../../node_modules/@types/node/v8.d.ts", + "../../node_modules/@types/node/vm.d.ts", + "../../node_modules/@types/node/wasi.d.ts", + "../../node_modules/@types/node/worker_threads.d.ts", + "../../node_modules/@types/node/zlib.d.ts" + ], + "../../node_modules/@types/node/tty.d.ts": [ + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/url.d.ts": [ + "../../node_modules/@types/node/querystring.d.ts" + ], + "../../node_modules/@types/node/v8.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/worker_threads.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts", + "../../node_modules/@types/node/vm.d.ts" + ], + "../../node_modules/@types/node/zlib.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../out/common/buffer/attributedata.d.ts": [ + "../../out/common/buffer/constants.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/buffer/bufferline.d.ts": [ + "../../out/common/buffer/attributedata.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/circularlist.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/coreterminal.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../out/common/inputhandler.d.ts", + "../../out/common/lifecycle.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/eventemitter.d.ts": [ + "../../src/common/types.d.ts" + ], + "../../out/common/inputhandler.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../out/common/lifecycle.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/lifecycle.d.ts": [ + "../../src/common/types.d.ts" + ], + "../../out/common/public/buffernamespaceapi.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/public/parserapi.d.ts": [ + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/public/unicodeapi.d.ts": [ + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/services/services.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/buffer/types.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/parser/types.d.ts": [ + "../../out/common/parser/constants.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/types.d.ts": [ + "../../out/common/circularlist.d.ts", + "../../out/common/eventemitter.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../src/headless/public/terminal.ts": [ + "../../out/common/eventemitter.d.ts", + "../../out/common/public/buffernamespaceapi.d.ts", + "../../out/common/public/parserapi.d.ts", + "../../out/common/public/unicodeapi.d.ts", + "../../src/headless/terminal.ts", + "../../typings/xterm-core.d.ts" + ], + "../../src/headless/terminal.ts": [ + "../../out/common/buffer/bufferline.d.ts", + "../../out/common/coreterminal.d.ts", + "../../out/common/eventemitter.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/headless/types.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ] + }, + "exportedModulesMap": { + "../../node_modules/@types/node/base.d.ts": [ + "../../node_modules/@types/node/assert.d.ts", + "../../node_modules/@types/node/ts3.6/base.d.ts" + ], + "../../node_modules/@types/node/child_process.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/cluster.d.ts": [ + "../../node_modules/@types/node/child_process.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/console.d.ts": [ + "../../node_modules/@types/node/util.d.ts" + ], + "../../node_modules/@types/node/constants.d.ts": [ + "../../node_modules/@types/node/crypto.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/os.d.ts" + ], + "../../node_modules/@types/node/crypto.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/dgram.d.ts": [ + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/domain.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/events.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/fs.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/fs/promises.d.ts": [ + "../../node_modules/@types/node/fs.d.ts" + ], + "../../node_modules/@types/node/http.d.ts": [ + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/http2.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/https.d.ts": [ + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/index.d.ts": [ + "../../node_modules/@types/node/base.d.ts" + ], + "../../node_modules/@types/node/inspector.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/module.d.ts": [ + "../../node_modules/@types/node/url.d.ts" + ], + "../../node_modules/@types/node/net.d.ts": [ + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/perf_hooks.d.ts": [ + "../../node_modules/@types/node/async_hooks.d.ts" + ], + "../../node_modules/@types/node/process.d.ts": [ + "../../node_modules/@types/node/tty.d.ts" + ], + "../../node_modules/@types/node/readline.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/repl.d.ts": [ + "../../node_modules/@types/node/readline.d.ts", + "../../node_modules/@types/node/util.d.ts", + "../../node_modules/@types/node/vm.d.ts" + ], + "../../node_modules/@types/node/stream.d.ts": [ + "../../node_modules/@types/node/events.d.ts" + ], + "../../node_modules/@types/node/tls.d.ts": [ + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/ts3.6/base.d.ts": [ + "../../node_modules/@types/node/async_hooks.d.ts", + "../../node_modules/@types/node/buffer.d.ts", + "../../node_modules/@types/node/child_process.d.ts", + "../../node_modules/@types/node/cluster.d.ts", + "../../node_modules/@types/node/console.d.ts", + "../../node_modules/@types/node/constants.d.ts", + "../../node_modules/@types/node/crypto.d.ts", + "../../node_modules/@types/node/dgram.d.ts", + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/domain.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/globals.d.ts", + "../../node_modules/@types/node/globals.global.d.ts", + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/http2.d.ts", + "../../node_modules/@types/node/https.d.ts", + "../../node_modules/@types/node/inspector.d.ts", + "../../node_modules/@types/node/module.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/os.d.ts", + "../../node_modules/@types/node/path.d.ts", + "../../node_modules/@types/node/perf_hooks.d.ts", + "../../node_modules/@types/node/process.d.ts", + "../../node_modules/@types/node/punycode.d.ts", + "../../node_modules/@types/node/querystring.d.ts", + "../../node_modules/@types/node/readline.d.ts", + "../../node_modules/@types/node/repl.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/string_decoder.d.ts", + "../../node_modules/@types/node/timers.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/trace_events.d.ts", + "../../node_modules/@types/node/tty.d.ts", + "../../node_modules/@types/node/url.d.ts", + "../../node_modules/@types/node/util.d.ts", + "../../node_modules/@types/node/v8.d.ts", + "../../node_modules/@types/node/vm.d.ts", + "../../node_modules/@types/node/wasi.d.ts", + "../../node_modules/@types/node/worker_threads.d.ts", + "../../node_modules/@types/node/zlib.d.ts" + ], + "../../node_modules/@types/node/tty.d.ts": [ + "../../node_modules/@types/node/net.d.ts" + ], + "../../node_modules/@types/node/url.d.ts": [ + "../../node_modules/@types/node/querystring.d.ts" + ], + "../../node_modules/@types/node/v8.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../node_modules/@types/node/worker_threads.d.ts": [ + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/url.d.ts", + "../../node_modules/@types/node/vm.d.ts" + ], + "../../node_modules/@types/node/zlib.d.ts": [ + "../../node_modules/@types/node/stream.d.ts" + ], + "../../out/common/buffer/attributedata.d.ts": [ + "../../out/common/buffer/constants.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/buffer/bufferline.d.ts": [ + "../../out/common/buffer/attributedata.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/circularlist.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/coreterminal.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../out/common/inputhandler.d.ts", + "../../out/common/lifecycle.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/eventemitter.d.ts": [ + "../../src/common/types.d.ts" + ], + "../../out/common/inputhandler.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../out/common/lifecycle.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../out/common/lifecycle.d.ts": [ + "../../src/common/types.d.ts" + ], + "../../out/common/public/buffernamespaceapi.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/public/parserapi.d.ts": [ + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/public/unicodeapi.d.ts": [ + "../../src/common/types.d.ts", + "../../typings/xterm.d.ts" + ], + "../../out/common/services/services.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/buffer/types.d.ts": [ + "../../src/common/eventemitter.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/parser/types.d.ts": [ + "../../src/common/parser/constants.ts", + "../../src/common/types.d.ts" + ], + "../../src/common/types.d.ts": [ + "../../src/common/buffer/types.d.ts", + "../../src/common/circularlist.ts", + "../../src/common/eventemitter.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/services/services.ts", + "../../typings/xterm.d.ts" + ], + "../../src/headless/public/terminal.ts": [ + "../../out/common/eventemitter.d.ts", + "../../typings/xterm-core.d.ts" + ], + "../../src/headless/terminal.ts": [ + "../../out/common/coreterminal.d.ts", + "../../out/common/eventemitter.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/types.d.ts" + ], + "../../src/headless/types.d.ts": [ + "../../out/common/eventemitter.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../node_modules/@types/mocha/index.d.ts", + "../../node_modules/@types/node/assert.d.ts", + "../../node_modules/@types/node/async_hooks.d.ts", + "../../node_modules/@types/node/base.d.ts", + "../../node_modules/@types/node/buffer.d.ts", + "../../node_modules/@types/node/child_process.d.ts", + "../../node_modules/@types/node/cluster.d.ts", + "../../node_modules/@types/node/console.d.ts", + "../../node_modules/@types/node/constants.d.ts", + "../../node_modules/@types/node/crypto.d.ts", + "../../node_modules/@types/node/dgram.d.ts", + "../../node_modules/@types/node/dns.d.ts", + "../../node_modules/@types/node/domain.d.ts", + "../../node_modules/@types/node/events.d.ts", + "../../node_modules/@types/node/fs.d.ts", + "../../node_modules/@types/node/fs/promises.d.ts", + "../../node_modules/@types/node/globals.d.ts", + "../../node_modules/@types/node/globals.global.d.ts", + "../../node_modules/@types/node/http.d.ts", + "../../node_modules/@types/node/http2.d.ts", + "../../node_modules/@types/node/https.d.ts", + "../../node_modules/@types/node/index.d.ts", + "../../node_modules/@types/node/inspector.d.ts", + "../../node_modules/@types/node/module.d.ts", + "../../node_modules/@types/node/net.d.ts", + "../../node_modules/@types/node/os.d.ts", + "../../node_modules/@types/node/path.d.ts", + "../../node_modules/@types/node/perf_hooks.d.ts", + "../../node_modules/@types/node/process.d.ts", + "../../node_modules/@types/node/punycode.d.ts", + "../../node_modules/@types/node/querystring.d.ts", + "../../node_modules/@types/node/readline.d.ts", + "../../node_modules/@types/node/repl.d.ts", + "../../node_modules/@types/node/stream.d.ts", + "../../node_modules/@types/node/string_decoder.d.ts", + "../../node_modules/@types/node/timers.d.ts", + "../../node_modules/@types/node/tls.d.ts", + "../../node_modules/@types/node/trace_events.d.ts", + "../../node_modules/@types/node/ts3.6/base.d.ts", + "../../node_modules/@types/node/tty.d.ts", + "../../node_modules/@types/node/url.d.ts", + "../../node_modules/@types/node/util.d.ts", + "../../node_modules/@types/node/v8.d.ts", + "../../node_modules/@types/node/vm.d.ts", + "../../node_modules/@types/node/wasi.d.ts", + "../../node_modules/@types/node/worker_threads.d.ts", + "../../node_modules/@types/node/zlib.d.ts", + "../../node_modules/typescript/lib/lib.dom.d.ts", + "../../node_modules/typescript/lib/lib.es2015.collection.d.ts", + "../../node_modules/typescript/lib/lib.es2015.core.d.ts", + "../../node_modules/typescript/lib/lib.es2015.d.ts", + "../../node_modules/typescript/lib/lib.es2015.generator.d.ts", + "../../node_modules/typescript/lib/lib.es2015.iterable.d.ts", + "../../node_modules/typescript/lib/lib.es2015.promise.d.ts", + "../../node_modules/typescript/lib/lib.es2015.proxy.d.ts", + "../../node_modules/typescript/lib/lib.es2015.reflect.d.ts", + "../../node_modules/typescript/lib/lib.es2015.symbol.d.ts", + "../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", + "../../node_modules/typescript/lib/lib.es2016.array.include.d.ts", + "../../node_modules/typescript/lib/lib.es2016.d.ts", + "../../node_modules/typescript/lib/lib.es2017.d.ts", + "../../node_modules/typescript/lib/lib.es2017.intl.d.ts", + "../../node_modules/typescript/lib/lib.es2017.object.d.ts", + "../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", + "../../node_modules/typescript/lib/lib.es2017.string.d.ts", + "../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", + "../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts", + "../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts", + "../../node_modules/typescript/lib/lib.es2018.d.ts", + "../../node_modules/typescript/lib/lib.es2018.intl.d.ts", + "../../node_modules/typescript/lib/lib.es2018.promise.d.ts", + "../../node_modules/typescript/lib/lib.es2018.regexp.d.ts", + "../../node_modules/typescript/lib/lib.es2020.bigint.d.ts", + "../../node_modules/typescript/lib/lib.es5.d.ts", + "../../node_modules/typescript/lib/lib.esnext.intl.d.ts", + "../../out/common/buffer/attributedata.d.ts", + "../../out/common/buffer/bufferline.d.ts", + "../../out/common/buffer/constants.d.ts", + "../../out/common/circularlist.d.ts", + "../../out/common/coreterminal.d.ts", + "../../out/common/eventemitter.d.ts", + "../../out/common/inputhandler.d.ts", + "../../out/common/lifecycle.d.ts", + "../../out/common/parser/constants.d.ts", + "../../out/common/public/buffernamespaceapi.d.ts", + "../../out/common/public/parserapi.d.ts", + "../../out/common/public/unicodeapi.d.ts", + "../../out/common/services/services.d.ts", + "../../src/common/buffer/types.d.ts", + "../../src/common/parser/types.d.ts", + "../../src/common/types.d.ts", + "../../src/headless/public/terminal.ts", + "../../src/headless/terminal.ts", + "../../src/headless/types.d.ts", + "../../typings/xterm-core.d.ts", + "../../typings/xterm.d.ts" + ] + }, + "version": "4.2.4" +} \ No newline at end of file diff --git a/headless/headless/types.d.ts b/headless/headless/types.d.ts new file mode 100644 index 00000000..a35f3988 --- /dev/null +++ b/headless/headless/types.d.ts @@ -0,0 +1,32 @@ +import { IBuffer, IBufferSet } from 'common/buffer/Types'; +import { IEvent } from 'common/EventEmitter'; +import { IFunctionIdentifier, IParams } from 'common/parser/Types'; +import { ICoreTerminal, IDisposable, IMarker, ITerminalOptions } from 'common/Types'; +export interface ITerminal extends ICoreTerminal { + rows: number; + cols: number; + buffer: IBuffer; + buffers: IBufferSet; + markers: IMarker[]; + options: ITerminalOptions; + onCursorMove: IEvent; + onData: IEvent; + onBinary: IEvent; + onLineFeed: IEvent; + onResize: IEvent<{ + cols: number; + rows: number; + }>; + onTitleChange: IEvent; + resize(columns: number, rows: number): void; + addCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean): IDisposable; + addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean): IDisposable; + addEscHandler(id: IFunctionIdentifier, callback: () => boolean): IDisposable; + addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; + addMarker(cursorYOffset: number): IMarker | undefined; + dispose(): void; + clear(): void; + write(data: string | Uint8Array, callback?: () => void): void; + reset(): void; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/headless/headless/types.d.ts.map b/headless/headless/types.d.ts.map new file mode 100644 index 00000000..7410b043 --- /dev/null +++ b/headless/headless/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/headless/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB,OAAO,EAAE,gBAAgB,CAAC;IAE1B,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,GAAG,WAAW,CAAC;IAC5F,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,WAAW,CAAC;IACzG,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,GAAG,WAAW,CAAC;IAC7E,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,WAAW,CAAC;IAC/E,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtD,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC9D,KAAK,IAAI,IAAI,CAAC;CACf"} \ No newline at end of file diff --git a/headless/headless/types.js b/headless/headless/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/headless/headless/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/headless/headless/types.js.map b/headless/headless/types.js.map new file mode 100644 index 00000000..d651a6aa --- /dev/null +++ b/headless/headless/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/headless/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/common/public/tsconfig.json b/src/common/public/tsconfig.json deleted file mode 100644 index 6e14ddf7..00000000 --- a/src/common/public/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "../../tsconfig-library-base", - "compilerOptions": { - "lib": [ - "es2015", - "es2016.Array.Include" - ], - "outDir": "../../../xterm-core", // Temporary outdir to avoid collisions with 'xterm' - "types": [ - "../../../node_modules/@types/mocha", - "../../../node_modules/@types/node" - ], - "baseUrl": "../../", - "extendedDiagnostics": true - }, - "include": [ - "../**/*", - "../../../typings/xterm-core.d.ts", - "../../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' - ], -} diff --git a/src/common/Terminal.ts b/src/headless/Terminal.ts similarity index 100% rename from src/common/Terminal.ts rename to src/headless/Terminal.ts diff --git a/src/common/public/types.ts b/src/headless/Types.d.ts similarity index 99% rename from src/common/public/types.ts rename to src/headless/Types.d.ts index 1c20bd6d..868e5c17 100644 --- a/src/common/public/types.ts +++ b/src/headless/Types.d.ts @@ -28,4 +28,4 @@ export interface ITerminal extends ICoreTerminal { clear(): void; write(data: string | Uint8Array, callback?: () => void): void; reset(): void; -} \ No newline at end of file +} diff --git a/src/common/public/Terminal.ts b/src/headless/public/Terminal.ts similarity index 98% rename from src/common/public/Terminal.ts rename to src/headless/public/Terminal.ts index 3d195b75..4b27a04b 100644 --- a/src/common/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -8,7 +8,7 @@ import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; -import { Terminal as TerminalCore } from '../Terminal'; +import { Terminal as TerminalCore } from 'headless/Terminal'; export class Terminal implements ITerminalApi { private _core: TerminalCore; diff --git a/src/headless/tsconfig.json b/src/headless/tsconfig.json new file mode 100644 index 00000000..268bdbdd --- /dev/null +++ b/src/headless/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "../tsconfig-library-base", + "compilerOptions": { + "lib": [ + "es2015", + "es2016.Array.Include" + ], + "outDir": "../../headless", // Temporary outdir to avoid collisions with 'xterm' + "types": [ + "../../node_modules/@types/mocha", + "../../node_modules/@types/node" + ], + "baseUrl": "../", + "extendedDiagnostics": true, + "paths": { + "common/*": [ "./common/*" ] + } + }, + "include": [ + "./**/*", + "../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' + "../../typings/xterm-core.d.ts" + ], + "references": [ + { "path": "../common" } + ] +} diff --git a/tsconfig.all.json b/tsconfig.all.json index 009cd498..6fa02446 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -3,6 +3,7 @@ "include": [], "references": [ { "path": "./src/browser" }, + { "path": "./src/headless" }, { "path": "./test/api" }, { "path": "./test/benchmark" }, { "path": "./addons/xterm-addon-attach" }, From 61ede1cc0d7fd40ba5556c93b20911b3cd5aa5de Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:41:24 -0700 Subject: [PATCH 07/42] Update instructions to run --- node-test/README.md | 4 ++-- core-webpack.config.js => webpack.config.core.js | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename core-webpack.config.js => webpack.config.core.js (100%) diff --git a/node-test/README.md b/node-test/README.md index e4cf19b0..b7a67aeb 100644 --- a/node-test/README.md +++ b/node-test/README.md @@ -3,8 +3,8 @@ Cursory test that 'xterm-core' works: ``` # From root of this repo npm run compile # Outputs to xterm-core -npx webpack --config core-webpack.config.js # Outputs to lib +npx webpack --config webpack.config.core.js # Outputs to lib cd node-test npm link ../lib/ node index.js -``` \ No newline at end of file +``` diff --git a/core-webpack.config.js b/webpack.config.core.js similarity index 100% rename from core-webpack.config.js rename to webpack.config.core.js From 71179512330199b530fa88bf74d93f22c5feceaf Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:52:27 -0700 Subject: [PATCH 08/42] Output headless to out/headless --- headless/headless/Terminal.d.ts | 28 - headless/headless/Terminal.d.ts.map | 1 - headless/headless/Terminal.js | 130 --- headless/headless/Terminal.js.map | 1 - headless/headless/public/Terminal.d.ts | 48 - headless/headless/public/Terminal.d.ts.map | 1 - headless/headless/public/Terminal.js | 147 --- headless/headless/public/Terminal.js.map | 1 - headless/headless/tsconfig.tsbuildinfo | 1120 -------------------- headless/headless/types.d.ts | 32 - headless/headless/types.d.ts.map | 1 - headless/headless/types.js | 3 - headless/headless/types.js.map | 1 - src/headless/tsconfig.json | 3 +- 14 files changed, 1 insertion(+), 1516 deletions(-) delete mode 100644 headless/headless/Terminal.d.ts delete mode 100644 headless/headless/Terminal.d.ts.map delete mode 100644 headless/headless/Terminal.js delete mode 100644 headless/headless/Terminal.js.map delete mode 100644 headless/headless/public/Terminal.d.ts delete mode 100644 headless/headless/public/Terminal.d.ts.map delete mode 100644 headless/headless/public/Terminal.js delete mode 100644 headless/headless/public/Terminal.js.map delete mode 100644 headless/headless/tsconfig.tsbuildinfo delete mode 100644 headless/headless/types.d.ts delete mode 100644 headless/headless/types.d.ts.map delete mode 100644 headless/headless/types.js delete mode 100644 headless/headless/types.js.map diff --git a/headless/headless/Terminal.d.ts b/headless/headless/Terminal.d.ts deleted file mode 100644 index 7ab11fc7..00000000 --- a/headless/headless/Terminal.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IBuffer } from 'common/buffer/Types'; -import { CoreTerminal } from 'common/CoreTerminal'; -import { IEvent } from 'common/EventEmitter'; -import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services'; -import { IMarker, ITerminalOptions } from 'common/Types'; -export declare class Terminal extends CoreTerminal { - get options(): IInitializedTerminalOptions; - private _onBell; - get onBell(): IEvent; - private _onCursorMove; - get onCursorMove(): IEvent; - private _onTitleChange; - get onTitleChange(): IEvent; - private _onA11yCharEmitter; - get onA11yChar(): IEvent; - private _onA11yTabEmitter; - get onA11yTab(): IEvent; - constructor(options?: ITerminalOptions); - dispose(): void; - get buffer(): IBuffer; - get markers(): IMarker[]; - addMarker(cursorYOffset: number): IMarker | undefined; - bell(): void; - resize(x: number, y: number): void; - clear(): void; - reset(): void; -} -//# sourceMappingURL=Terminal.d.ts.map \ No newline at end of file diff --git a/headless/headless/Terminal.d.ts.map b/headless/headless/Terminal.d.ts.map deleted file mode 100644 index f5020f83..00000000 --- a/headless/headless/Terminal.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../src/headless/Terminal.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAA8B,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,gBAAgB,IAAI,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,cAAc,CAAC;AAEvE,qBAAa,QAAS,SAAQ,YAAY;IAExC,IAAW,OAAO,IAAI,2BAA2B,CAAwC;IAGzF,OAAO,CAAC,OAAO,CAA6B;IAC5C,IAAW,MAAM,IAAK,MAAM,CAAC,IAAI,CAAC,CAA+B;IACjE,OAAO,CAAC,aAAa,CAA4B;IACjD,IAAW,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,CAAqC;IAC5E,OAAO,CAAC,cAAc,CAA8B;IACpD,IAAW,aAAa,IAAI,MAAM,CAAC,MAAM,CAAC,CAAsC;IAEhF,OAAO,CAAC,kBAAkB,CAA8B;IACxD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,CAA0C;IACjF,OAAO,CAAC,iBAAiB,CAA8B;IACvD,IAAW,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,CAAyC;gBAe7E,OAAO,GAAE,gBAAqB;IAezB,OAAO,IAAI,IAAI;IAWtB,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,OAAO,IAAI,OAAO,EAAE,CAE9B;IAEM,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IASrD,IAAI,IAAI,IAAI;IAUZ,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAWlC,KAAK,IAAI,IAAI;IAwBb,KAAK,IAAI,IAAI;CAWrB"} \ No newline at end of file diff --git a/headless/headless/Terminal.js b/headless/headless/Terminal.js deleted file mode 100644 index 66f4d364..00000000 --- a/headless/headless/Terminal.js +++ /dev/null @@ -1,130 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Terminal = void 0; -var BufferLine_1 = require("common/buffer/BufferLine"); -var CoreTerminal_1 = require("common/CoreTerminal"); -var EventEmitter_1 = require("common/EventEmitter"); -var Terminal = (function (_super) { - __extends(Terminal, _super); - function Terminal(options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this, options) || this; - _this._onBell = new EventEmitter_1.EventEmitter(); - _this._onCursorMove = new EventEmitter_1.EventEmitter(); - _this._onTitleChange = new EventEmitter_1.EventEmitter(); - _this._onA11yCharEmitter = new EventEmitter_1.EventEmitter(); - _this._onA11yTabEmitter = new EventEmitter_1.EventEmitter(); - _this._setup(); - _this.register(_this._inputHandler.onRequestBell(function () { return _this.bell(); })); - _this.register(_this._inputHandler.onRequestReset(function () { return _this.reset(); })); - _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onCursorMove, _this._onCursorMove)); - _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onTitleChange, _this._onTitleChange)); - _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onA11yChar, _this._onA11yCharEmitter)); - _this.register(EventEmitter_1.forwardEvent(_this._inputHandler.onA11yTab, _this._onA11yTabEmitter)); - return _this; - } - Object.defineProperty(Terminal.prototype, "options", { - get: function () { return this.optionsService.options; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onBell", { - get: function () { return this._onBell.event; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onCursorMove", { - get: function () { return this._onCursorMove.event; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onTitleChange", { - get: function () { return this._onTitleChange.event; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onA11yChar", { - get: function () { return this._onA11yCharEmitter.event; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onA11yTab", { - get: function () { return this._onA11yTabEmitter.event; }, - enumerable: false, - configurable: true - }); - Terminal.prototype.dispose = function () { - if (this._isDisposed) { - return; - } - _super.prototype.dispose.call(this); - this.write = function () { }; - }; - Object.defineProperty(Terminal.prototype, "buffer", { - get: function () { - return this.buffers.active; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "markers", { - get: function () { - return this.buffer.markers; - }, - enumerable: false, - configurable: true - }); - Terminal.prototype.addMarker = function (cursorYOffset) { - if (this.buffer !== this.buffers.normal) { - return; - } - return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); - }; - Terminal.prototype.bell = function () { - this._onBell.fire(); - }; - Terminal.prototype.resize = function (x, y) { - if (x === this.cols && y === this.rows) { - return; - } - _super.prototype.resize.call(this, x, y); - }; - Terminal.prototype.clear = function () { - if (this.buffer.ybase === 0 && this.buffer.y === 0) { - return; - } - this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)); - this.buffer.lines.length = 1; - this.buffer.ydisp = 0; - this.buffer.ybase = 0; - this.buffer.y = 0; - for (var i = 1; i < this.rows; i++) { - this.buffer.lines.push(this.buffer.getBlankLine(BufferLine_1.DEFAULT_ATTR_DATA)); - } - this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }); - }; - Terminal.prototype.reset = function () { - this.options.rows = this.rows; - this.options.cols = this.cols; - this._setup(); - _super.prototype.reset.call(this); - }; - return Terminal; -}(CoreTerminal_1.CoreTerminal)); -exports.Terminal = Terminal; -//# sourceMappingURL=Terminal.js.map \ No newline at end of file diff --git a/headless/headless/Terminal.js.map b/headless/headless/Terminal.js.map deleted file mode 100644 index ba7e26de..00000000 --- a/headless/headless/Terminal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../src/headless/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/public/Terminal.d.ts b/headless/headless/public/Terminal.d.ts deleted file mode 100644 index 669fff57..00000000 --- a/headless/headless/public/Terminal.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IEvent } from 'common/EventEmitter'; -import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; -export declare class Terminal implements ITerminalApi { - private _core; - private _parser; - private _buffer; - constructor(options?: ITerminalOptions); - private _checkProposedApi; - get onCursorMove(): IEvent; - get onLineFeed(): IEvent; - get onData(): IEvent; - get onBinary(): IEvent; - get onTitleChange(): IEvent; - get onResize(): IEvent<{ - cols: number; - rows: number; - }>; - get parser(): IParser; - get unicode(): IUnicodeHandling; - get rows(): number; - get cols(): number; - get buffer(): IBufferNamespaceApi; - get markers(): ReadonlyArray; - resize(columns: number, rows: number): void; - registerMarker(cursorYOffset: number): IMarker | undefined; - addMarker(cursorYOffset: number): IMarker | undefined; - dispose(): void; - clear(): void; - write(data: string | Uint8Array, callback?: () => void): void; - writeUtf8(data: Uint8Array, callback?: () => void): void; - writeln(data: string | Uint8Array, callback?: () => void): void; - getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string; - getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean; - getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; - getOption(key: string): any; - setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void; - setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void; - setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void; - setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void; - setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void; - setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void; - setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; - setOption(key: 'cols' | 'rows', value: number): void; - setOption(key: string, value: any): void; - reset(): void; - private _verifyIntegers; -} -//# sourceMappingURL=Terminal.d.ts.map \ No newline at end of file diff --git a/headless/headless/public/Terminal.d.ts.map b/headless/headless/public/Terminal.d.ts.map deleted file mode 100644 index b8fda933..00000000 --- a/headless/headless/public/Terminal.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../../src/headless/public/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/public/Terminal.js b/headless/headless/public/Terminal.js deleted file mode 100644 index 1718c3b6..00000000 --- a/headless/headless/public/Terminal.js +++ /dev/null @@ -1,147 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Terminal = void 0; -var BufferNamespaceApi_1 = require("common/public/BufferNamespaceApi"); -var ParserApi_1 = require("common/public/ParserApi"); -var UnicodeApi_1 = require("common/public/UnicodeApi"); -var Terminal_1 = require("headless/Terminal"); -var Terminal = (function () { - function Terminal(options) { - this._core = new Terminal_1.Terminal(options); - } - Terminal.prototype._checkProposedApi = function () { - if (!this._core.optionsService.options.allowProposedApi) { - throw new Error('You must set the allowProposedApi option to true to use proposed API'); - } - }; - Object.defineProperty(Terminal.prototype, "onCursorMove", { - get: function () { return this._core.onCursorMove; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onLineFeed", { - get: function () { return this._core.onLineFeed; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onData", { - get: function () { return this._core.onData; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onBinary", { - get: function () { return this._core.onBinary; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onTitleChange", { - get: function () { return this._core.onTitleChange; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "onResize", { - get: function () { return this._core.onResize; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "parser", { - get: function () { - this._checkProposedApi(); - if (!this._parser) { - this._parser = new ParserApi_1.ParserApi(this._core); - } - return this._parser; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "unicode", { - get: function () { - this._checkProposedApi(); - return new UnicodeApi_1.UnicodeApi(this._core); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "rows", { - get: function () { return this._core.rows; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "cols", { - get: function () { return this._core.cols; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "buffer", { - get: function () { - this._checkProposedApi(); - if (!this._buffer) { - this._buffer = new BufferNamespaceApi_1.BufferNamespaceApi(this._core); - } - return this._buffer; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Terminal.prototype, "markers", { - get: function () { - this._checkProposedApi(); - return this._core.markers; - }, - enumerable: false, - configurable: true - }); - Terminal.prototype.resize = function (columns, rows) { - this._verifyIntegers(columns, rows); - this._core.resize(columns, rows); - }; - Terminal.prototype.registerMarker = function (cursorYOffset) { - this._checkProposedApi(); - this._verifyIntegers(cursorYOffset); - return this._core.addMarker(cursorYOffset); - }; - Terminal.prototype.addMarker = function (cursorYOffset) { - return this.registerMarker(cursorYOffset); - }; - Terminal.prototype.dispose = function () { - this._core.dispose(); - }; - Terminal.prototype.clear = function () { - this._core.clear(); - }; - Terminal.prototype.write = function (data, callback) { - this._core.write(data, callback); - }; - Terminal.prototype.writeUtf8 = function (data, callback) { - this._core.write(data, callback); - }; - Terminal.prototype.writeln = function (data, callback) { - this._core.write(data); - this._core.write('\r\n', callback); - }; - Terminal.prototype.getOption = function (key) { - return this._core.optionsService.getOption(key); - }; - Terminal.prototype.setOption = function (key, value) { - this._core.optionsService.setOption(key, value); - }; - Terminal.prototype.reset = function () { - this._core.reset(); - }; - Terminal.prototype._verifyIntegers = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - for (var _a = 0, values_1 = values; _a < values_1.length; _a++) { - var value = values_1[_a]; - if (value === Infinity || isNaN(value) || value % 1 !== 0) { - throw new Error('This API only accepts integers'); - } - } - }; - return Terminal; -}()); -exports.Terminal = Terminal; -//# sourceMappingURL=Terminal.js.map \ No newline at end of file diff --git a/headless/headless/public/Terminal.js.map b/headless/headless/public/Terminal.js.map deleted file mode 100644 index 6e27bbc7..00000000 --- a/headless/headless/public/Terminal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/headless/public/Terminal.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/headless/headless/tsconfig.tsbuildinfo b/headless/headless/tsconfig.tsbuildinfo deleted file mode 100644 index 7307c747..00000000 --- a/headless/headless/tsconfig.tsbuildinfo +++ /dev/null @@ -1,1120 +0,0 @@ -{ - "program": { - "fileInfos": { - "../../node_modules/typescript/lib/lib.es5.d.ts": { - "version": "b3584bc5798ed422ce2516df360ffa9cf2d80b5eae852867db9ba3743145f895", - "signature": "b3584bc5798ed422ce2516df360ffa9cf2d80b5eae852867db9ba3743145f895", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.d.ts": { - "version": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", - "signature": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", - "affectsGlobalScope": false - }, - "../../node_modules/typescript/lib/lib.es2016.d.ts": { - "version": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", - "signature": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", - "affectsGlobalScope": false - }, - "../../node_modules/typescript/lib/lib.es2017.d.ts": { - "version": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", - "signature": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", - "affectsGlobalScope": false - }, - "../../node_modules/typescript/lib/lib.es2018.d.ts": { - "version": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", - "signature": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", - "affectsGlobalScope": false - }, - "../../node_modules/typescript/lib/lib.dom.d.ts": { - "version": "feeeb1dd8a80fb76be42b0426e8f3ffa9bdef3c2f3c12c147e7660b1c5ba8b3b", - "signature": "feeeb1dd8a80fb76be42b0426e8f3ffa9bdef3c2f3c12c147e7660b1c5ba8b3b", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.core.d.ts": { - "version": "46ee15e9fefa913333b61eaf6b18885900b139867d89832a515059b62cf16a17", - "signature": "46ee15e9fefa913333b61eaf6b18885900b139867d89832a515059b62cf16a17", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.collection.d.ts": { - "version": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", - "signature": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.generator.d.ts": { - "version": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", - "signature": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.iterable.d.ts": { - "version": "8b2a5df1ce95f78f6b74f1a555ccdb6baab0486b42d8345e0871dd82811f9b9a", - "signature": "8b2a5df1ce95f78f6b74f1a555ccdb6baab0486b42d8345e0871dd82811f9b9a", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.promise.d.ts": { - "version": "2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c", - "signature": "2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.proxy.d.ts": { - "version": "810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357", - "signature": "810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.reflect.d.ts": { - "version": "62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6", - "signature": "62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.symbol.d.ts": { - "version": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", - "signature": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { - "version": "9d122b7e8c1a5c72506eea50c0973cba55b92b5532d5cafa8a6ce2c547d57551", - "signature": "9d122b7e8c1a5c72506eea50c0973cba55b92b5532d5cafa8a6ce2c547d57551", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2016.array.include.d.ts": { - "version": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", - "signature": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2017.object.d.ts": { - "version": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", - "signature": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { - "version": "7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98", - "signature": "7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2017.string.d.ts": { - "version": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", - "signature": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2017.intl.d.ts": { - "version": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", - "signature": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { - "version": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", - "signature": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts": { - "version": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", - "signature": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": { - "version": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", - "signature": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2018.intl.d.ts": { - "version": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", - "signature": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2018.promise.d.ts": { - "version": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", - "signature": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2018.regexp.d.ts": { - "version": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", - "signature": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.es2020.bigint.d.ts": { - "version": "7b5a10e3c897fabece5a51aa85b4111727d7adb53c2734b5d37230ff96802a09", - "signature": "7b5a10e3c897fabece5a51aa85b4111727d7adb53c2734b5d37230ff96802a09", - "affectsGlobalScope": true - }, - "../../node_modules/typescript/lib/lib.esnext.intl.d.ts": { - "version": "506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e", - "signature": "506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e", - "affectsGlobalScope": true - }, - "../../out/common/eventemitter.d.ts": { - "version": "5b03a7f7f7f551e3fe0e92da13d2e17e7ad7ee19c41d0637f4edbc120bc06f66", - "signature": "5b03a7f7f7f551e3fe0e92da13d2e17e7ad7ee19c41d0637f4edbc120bc06f66", - "affectsGlobalScope": false - }, - "../../out/common/circularlist.d.ts": { - "version": "f96222a7fe4af80068de748cd4bd0b247359b303c72cc827e887eaf6ef9fb758", - "signature": "f96222a7fe4af80068de748cd4bd0b247359b303c72cc827e887eaf6ef9fb758", - "affectsGlobalScope": false - }, - "../../out/common/parser/constants.d.ts": { - "version": "ae42446973a3c189ecac84723e74828ee292f9392935db874cb27ee19ca89093", - "signature": "ae42446973a3c189ecac84723e74828ee292f9392935db874cb27ee19ca89093", - "affectsGlobalScope": false - }, - "../../src/common/parser/types.d.ts": { - "version": "55b56377b6fa8b93856027f20ebaccd8e0c77d4327e45e45b5e2041cf94011cc", - "signature": "55b56377b6fa8b93856027f20ebaccd8e0c77d4327e45e45b5e2041cf94011cc", - "affectsGlobalScope": false - }, - "../../src/common/buffer/types.d.ts": { - "version": "5e2f59fc5cb1b39a2e163bafe30139a33dac4033edcb9b1b831d542abb7f7bae", - "signature": "5e2f59fc5cb1b39a2e163bafe30139a33dac4033edcb9b1b831d542abb7f7bae", - "affectsGlobalScope": false - }, - "../../out/common/services/services.d.ts": { - "version": "4672a4d6d71a25b4592922ecd70094e932348a031d39acc4cef027ea9b62cba0", - "signature": "4672a4d6d71a25b4592922ecd70094e932348a031d39acc4cef027ea9b62cba0", - "affectsGlobalScope": false - }, - "../../src/common/types.d.ts": { - "version": "d7d8eb9c47232c80348f2fc6c8eb7d3acb329b6d8fdcf1f1c38d6e5099f8370b", - "signature": "d7d8eb9c47232c80348f2fc6c8eb7d3acb329b6d8fdcf1f1c38d6e5099f8370b", - "affectsGlobalScope": false - }, - "../../out/common/buffer/constants.d.ts": { - "version": "ff74cff1b7fe399447fd661d0c68586e7b991d11d044af133963c04bde38a852", - "signature": "ff74cff1b7fe399447fd661d0c68586e7b991d11d044af133963c04bde38a852", - "affectsGlobalScope": false - }, - "../../out/common/buffer/attributedata.d.ts": { - "version": "421bb313e7b328ba640853d13b584fe7815b818bd02584d020a41b7a7120d262", - "signature": "421bb313e7b328ba640853d13b584fe7815b818bd02584d020a41b7a7120d262", - "affectsGlobalScope": false - }, - "../../out/common/buffer/bufferline.d.ts": { - "version": "baaa0fc61cb33a67caa0abb986740700be9313c6866ed78c17193e87ca7057a1", - "signature": "baaa0fc61cb33a67caa0abb986740700be9313c6866ed78c17193e87ca7057a1", - "affectsGlobalScope": false - }, - "../../out/common/lifecycle.d.ts": { - "version": "0ba457ac19650eb9dffb8216ca42947899613be5aee16f3809fe39187c30423e", - "signature": "0ba457ac19650eb9dffb8216ca42947899613be5aee16f3809fe39187c30423e", - "affectsGlobalScope": false - }, - "../../out/common/inputhandler.d.ts": { - "version": "542507ad71abebbfe8b5da8758e1aa47bfce3acd0da245f10885cab9934b71d6", - "signature": "542507ad71abebbfe8b5da8758e1aa47bfce3acd0da245f10885cab9934b71d6", - "affectsGlobalScope": false - }, - "../../out/common/coreterminal.d.ts": { - "version": "ab615cd4d0ef6f17d26eef27cdf5beec0e081e59b5eefb09ede878c2cabb4c15", - "signature": "ab615cd4d0ef6f17d26eef27cdf5beec0e081e59b5eefb09ede878c2cabb4c15", - "affectsGlobalScope": false - }, - "../../src/headless/terminal.ts": { - "version": "59209d1535dcfbe8bac847ccf13e829a9ea692ce58fdcb3ee3605791ae60b564", - "signature": "5311ffa92a616a0729010de20af2272185a8b65b51ac26a496326b3b32aad8cc", - "affectsGlobalScope": false - }, - "../../src/headless/types.d.ts": { - "version": "d51941b70feb73ac171f24e34f11de9be17d0c4f224da1a6ed39fe8c31ba6695", - "signature": "d51941b70feb73ac171f24e34f11de9be17d0c4f224da1a6ed39fe8c31ba6695", - "affectsGlobalScope": false - }, - "../../out/common/public/buffernamespaceapi.d.ts": { - "version": "1f8e93ce424bd436ad641d8313d849af586a3779adbfd870e1cfee72a212ae57", - "signature": "1f8e93ce424bd436ad641d8313d849af586a3779adbfd870e1cfee72a212ae57", - "affectsGlobalScope": false - }, - "../../out/common/public/parserapi.d.ts": { - "version": "7c0d242565ad3b41ef8666e46fbd88aec222d2e9b2a343ac315b00373401ffc2", - "signature": "7c0d242565ad3b41ef8666e46fbd88aec222d2e9b2a343ac315b00373401ffc2", - "affectsGlobalScope": false - }, - "../../out/common/public/unicodeapi.d.ts": { - "version": "d77b28e85c1bbc95897707b719c4797ac94f5bf76572c81baae195787133826c", - "signature": "d77b28e85c1bbc95897707b719c4797ac94f5bf76572c81baae195787133826c", - "affectsGlobalScope": false - }, - "../../src/headless/public/terminal.ts": { - "version": "fce93b9408e0c088a1c6802aff2cf8cc46ac0feddc59f26b5a3241d0f03c82db", - "signature": "503924e7f37322f587ebce5459da9c47860c843c0d30d6d09b6ba25d5d169ac7", - "affectsGlobalScope": false - }, - "../../typings/xterm.d.ts": { - "version": "d5256f76893350e4897436490570d291be7a2a005d44e3fa221f1a19804b8c5e", - "signature": "d5256f76893350e4897436490570d291be7a2a005d44e3fa221f1a19804b8c5e", - "affectsGlobalScope": false - }, - "../../typings/xterm-core.d.ts": { - "version": "675fd5779b700c3e864a36a14db728d91027632f90e60c7bfd440b5db61e174d", - "signature": "675fd5779b700c3e864a36a14db728d91027632f90e60c7bfd440b5db61e174d", - "affectsGlobalScope": false - }, - "../../node_modules/@types/mocha/index.d.ts": { - "version": "0359800d3b440f8515001431cde1500944e156040577425eb3f7b80af0846612", - "signature": "0359800d3b440f8515001431cde1500944e156040577425eb3f7b80af0846612", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/globals.d.ts": { - "version": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", - "signature": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/async_hooks.d.ts": { - "version": "c9e8a340da877b05a52525554aa255b3f44958c7f6748ebf5cbe0bfbe6766878", - "signature": "c9e8a340da877b05a52525554aa255b3f44958c7f6748ebf5cbe0bfbe6766878", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/buffer.d.ts": { - "version": "a473cf45c3d9809518f8af913312139d9f4db6887dc554e0d06d0f4e52722e6b", - "signature": "a473cf45c3d9809518f8af913312139d9f4db6887dc554e0d06d0f4e52722e6b", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/child_process.d.ts": { - "version": "a668dfae917097b30fc29bbebeeb869cee22529f2aa9976cea03c7e834a1b841", - "signature": "a668dfae917097b30fc29bbebeeb869cee22529f2aa9976cea03c7e834a1b841", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/cluster.d.ts": { - "version": "04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef", - "signature": "04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/console.d.ts": { - "version": "c8155caf28fc7b0a564156a5df28ad8a844a3bd32d331d148d8f3ce88025c870", - "signature": "c8155caf28fc7b0a564156a5df28ad8a844a3bd32d331d148d8f3ce88025c870", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/constants.d.ts": { - "version": "45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491", - "signature": "45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/crypto.d.ts": { - "version": "0084b54e281a37c75079f92ca20603d5731de063e7a425852b2907de4dd19932", - "signature": "0084b54e281a37c75079f92ca20603d5731de063e7a425852b2907de4dd19932", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/dgram.d.ts": { - "version": "797a9d37eb1f76143311c3f0a186ce5c0d8735e94c0ca08ff8712a876c9b4f9e", - "signature": "797a9d37eb1f76143311c3f0a186ce5c0d8735e94c0ca08ff8712a876c9b4f9e", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/dns.d.ts": { - "version": "bc31e01146eec89eb870b9ad8c55d759bcbc8989a894e6f0f81f832e0d10eb04", - "signature": "bc31e01146eec89eb870b9ad8c55d759bcbc8989a894e6f0f81f832e0d10eb04", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/domain.d.ts": { - "version": "2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5", - "signature": "2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/events.d.ts": { - "version": "153d835dc32985120790e10102834b0a5bd979bb5e42bfbb33c0ff6260cf03ce", - "signature": "153d835dc32985120790e10102834b0a5bd979bb5e42bfbb33c0ff6260cf03ce", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/fs.d.ts": { - "version": "a44c87a409b60f211a240341905d818f5f173420dcf7f989ee6c8a1a3d812ae9", - "signature": "a44c87a409b60f211a240341905d818f5f173420dcf7f989ee6c8a1a3d812ae9", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/fs/promises.d.ts": { - "version": "bdaf554ae2d9d09e2a42f58a29ef7f80e5b5c1d7b96bfb717243dc91a477216e", - "signature": "bdaf554ae2d9d09e2a42f58a29ef7f80e5b5c1d7b96bfb717243dc91a477216e", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/http.d.ts": { - "version": "dce8672a79c7221c10a355b905940ab57505bc480a72a5da33ba24cbf82bb75c", - "signature": "dce8672a79c7221c10a355b905940ab57505bc480a72a5da33ba24cbf82bb75c", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/http2.d.ts": { - "version": "321ea733ae7f611077a2d7b4bc378ac4a6b7e365e1a51c71a7e5b2818e1e310a", - "signature": "321ea733ae7f611077a2d7b4bc378ac4a6b7e365e1a51c71a7e5b2818e1e310a", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/https.d.ts": { - "version": "13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452", - "signature": "13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/inspector.d.ts": { - "version": "42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8", - "signature": "42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/module.d.ts": { - "version": "0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d", - "signature": "0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/net.d.ts": { - "version": "40b957b502b40dd490ee334aed47a30636f8d14a0267d1b6c088c2be1dcf2757", - "signature": "40b957b502b40dd490ee334aed47a30636f8d14a0267d1b6c088c2be1dcf2757", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/os.d.ts": { - "version": "69640cc2e76dad52daeb9914e6b70c5c9a5591a3a65190a2d3ea432cf0015e16", - "signature": "69640cc2e76dad52daeb9914e6b70c5c9a5591a3a65190a2d3ea432cf0015e16", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/path.d.ts": { - "version": "21e64a125f65dff99cc3ed366c96e922b90daed343eb52ecdace5f220401dcda", - "signature": "21e64a125f65dff99cc3ed366c96e922b90daed343eb52ecdace5f220401dcda", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/perf_hooks.d.ts": { - "version": "4982d94cb6427263c8839d8d6324a8bbe129e931deb61a7380f8fad17ba2cfc0", - "signature": "4982d94cb6427263c8839d8d6324a8bbe129e931deb61a7380f8fad17ba2cfc0", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/process.d.ts": { - "version": "b0b00cf2e8107ab671243a73d2fbd6296a853bebe3fcfaaca293f65aaa245eaf", - "signature": "b0b00cf2e8107ab671243a73d2fbd6296a853bebe3fcfaaca293f65aaa245eaf", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/punycode.d.ts": { - "version": "7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6", - "signature": "7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/querystring.d.ts": { - "version": "992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58", - "signature": "992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/readline.d.ts": { - "version": "3b790d08129aca55fd5ae1672d1d26594147ac0d5f2eedc30c7575eb18daef7e", - "signature": "3b790d08129aca55fd5ae1672d1d26594147ac0d5f2eedc30c7575eb18daef7e", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/repl.d.ts": { - "version": "64535caf208a02420d2d04eb2029269efedd11eb8597ada0d5e6f3d54ec663ae", - "signature": "64535caf208a02420d2d04eb2029269efedd11eb8597ada0d5e6f3d54ec663ae", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/stream.d.ts": { - "version": "e7b5a3f40f19d9eea71890c70dfb37ac5dd82cbffe5f95bc8f23c536455732d0", - "signature": "e7b5a3f40f19d9eea71890c70dfb37ac5dd82cbffe5f95bc8f23c536455732d0", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/string_decoder.d.ts": { - "version": "4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50", - "signature": "4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/timers.d.ts": { - "version": "0953427f9c2498f71dd912fdd8a81b19cf6925de3e1ad67ab9a77b9a0f79bf0b", - "signature": "0953427f9c2498f71dd912fdd8a81b19cf6925de3e1ad67ab9a77b9a0f79bf0b", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/tls.d.ts": { - "version": "f89a6d56f0267f6e73c707f8a89d2f38e9928e10bfa505f39a4f4bf954093aee", - "signature": "f89a6d56f0267f6e73c707f8a89d2f38e9928e10bfa505f39a4f4bf954093aee", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/trace_events.d.ts": { - "version": "7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4", - "signature": "7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/tty.d.ts": { - "version": "9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5", - "signature": "9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/url.d.ts": { - "version": "dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9", - "signature": "dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/util.d.ts": { - "version": "e649840284bab8c4d09cadc125cd7fbde7529690cc1a0881872b6a9cd202819b", - "signature": "e649840284bab8c4d09cadc125cd7fbde7529690cc1a0881872b6a9cd202819b", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/v8.d.ts": { - "version": "a364b4a8a015ae377052fa4fac94204d79a69d879567f444c7ceff1b7a18482d", - "signature": "a364b4a8a015ae377052fa4fac94204d79a69d879567f444c7ceff1b7a18482d", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/vm.d.ts": { - "version": "1aa7dbace2b7b2ef60897dcd4f66252ee6ba85e594ded8918c9acdcecda1896c", - "signature": "1aa7dbace2b7b2ef60897dcd4f66252ee6ba85e594ded8918c9acdcecda1896c", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/worker_threads.d.ts": { - "version": "6c63cb179eda2be5ab45dc146fa4151bec8ce4781986935fe40adfc69cbbf214", - "signature": "6c63cb179eda2be5ab45dc146fa4151bec8ce4781986935fe40adfc69cbbf214", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/zlib.d.ts": { - "version": "4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875", - "signature": "4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/globals.global.d.ts": { - "version": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", - "signature": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", - "affectsGlobalScope": true - }, - "../../node_modules/@types/node/wasi.d.ts": { - "version": "4e0a4d84b15692ea8669fe4f3d05a4f204567906b1347da7a58b75f45bae48d3", - "signature": "4e0a4d84b15692ea8669fe4f3d05a4f204567906b1347da7a58b75f45bae48d3", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/ts3.6/base.d.ts": { - "version": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", - "signature": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/assert.d.ts": { - "version": "b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76", - "signature": "b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/base.d.ts": { - "version": "e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b", - "signature": "e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b", - "affectsGlobalScope": false - }, - "../../node_modules/@types/node/index.d.ts": { - "version": "6c137dee82a61e14a1eb6a0ba56925b66fd83abf15acf72fe59a10b15e80e319", - "signature": "6c137dee82a61e14a1eb6a0ba56925b66fd83abf15acf72fe59a10b15e80e319", - "affectsGlobalScope": false - } - }, - "options": { - "target": 1, - "lib": [ - "lib.es2015.d.ts", - "lib.es2016.array.include.d.ts" - ], - "rootDir": "../../src", - "sourceMap": true, - "removeComments": true, - "pretty": true, - "incremental": true, - "experimentalDecorators": true, - "composite": true, - "strict": true, - "declarationMap": true, - "outDir": "..", - "types": [ - "../../node_modules/@types/mocha", - "../../node_modules/@types/node" - ], - "baseUrl": "../../src", - "extendedDiagnostics": true, - "paths": { - "common/*": [ - "./common/*" - ] - }, - "pathsBasePath": "D:/GitHub/Tyriar/xterm.js/src/headless", - "watch": true, - "preserveWatchOutput": true, - "configFilePath": "../../src/headless/tsconfig.json" - }, - "referencedMap": { - "../../node_modules/@types/node/base.d.ts": [ - "../../node_modules/@types/node/assert.d.ts", - "../../node_modules/@types/node/ts3.6/base.d.ts" - ], - "../../node_modules/@types/node/child_process.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/cluster.d.ts": [ - "../../node_modules/@types/node/child_process.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/console.d.ts": [ - "../../node_modules/@types/node/util.d.ts" - ], - "../../node_modules/@types/node/constants.d.ts": [ - "../../node_modules/@types/node/crypto.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/os.d.ts" - ], - "../../node_modules/@types/node/crypto.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/dgram.d.ts": [ - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/domain.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/events.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/fs.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/fs/promises.d.ts": [ - "../../node_modules/@types/node/fs.d.ts" - ], - "../../node_modules/@types/node/http.d.ts": [ - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/http2.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/https.d.ts": [ - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/index.d.ts": [ - "../../node_modules/@types/node/base.d.ts" - ], - "../../node_modules/@types/node/inspector.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/module.d.ts": [ - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/net.d.ts": [ - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/perf_hooks.d.ts": [ - "../../node_modules/@types/node/async_hooks.d.ts" - ], - "../../node_modules/@types/node/process.d.ts": [ - "../../node_modules/@types/node/tty.d.ts" - ], - "../../node_modules/@types/node/readline.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/repl.d.ts": [ - "../../node_modules/@types/node/readline.d.ts", - "../../node_modules/@types/node/util.d.ts", - "../../node_modules/@types/node/vm.d.ts" - ], - "../../node_modules/@types/node/stream.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/tls.d.ts": [ - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/ts3.6/base.d.ts": [ - "../../node_modules/@types/node/async_hooks.d.ts", - "../../node_modules/@types/node/buffer.d.ts", - "../../node_modules/@types/node/child_process.d.ts", - "../../node_modules/@types/node/cluster.d.ts", - "../../node_modules/@types/node/console.d.ts", - "../../node_modules/@types/node/constants.d.ts", - "../../node_modules/@types/node/crypto.d.ts", - "../../node_modules/@types/node/dgram.d.ts", - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/domain.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/globals.d.ts", - "../../node_modules/@types/node/globals.global.d.ts", - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/http2.d.ts", - "../../node_modules/@types/node/https.d.ts", - "../../node_modules/@types/node/inspector.d.ts", - "../../node_modules/@types/node/module.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/os.d.ts", - "../../node_modules/@types/node/path.d.ts", - "../../node_modules/@types/node/perf_hooks.d.ts", - "../../node_modules/@types/node/process.d.ts", - "../../node_modules/@types/node/punycode.d.ts", - "../../node_modules/@types/node/querystring.d.ts", - "../../node_modules/@types/node/readline.d.ts", - "../../node_modules/@types/node/repl.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/string_decoder.d.ts", - "../../node_modules/@types/node/timers.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/trace_events.d.ts", - "../../node_modules/@types/node/tty.d.ts", - "../../node_modules/@types/node/url.d.ts", - "../../node_modules/@types/node/util.d.ts", - "../../node_modules/@types/node/v8.d.ts", - "../../node_modules/@types/node/vm.d.ts", - "../../node_modules/@types/node/wasi.d.ts", - "../../node_modules/@types/node/worker_threads.d.ts", - "../../node_modules/@types/node/zlib.d.ts" - ], - "../../node_modules/@types/node/tty.d.ts": [ - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/url.d.ts": [ - "../../node_modules/@types/node/querystring.d.ts" - ], - "../../node_modules/@types/node/v8.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/worker_threads.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts", - "../../node_modules/@types/node/vm.d.ts" - ], - "../../node_modules/@types/node/zlib.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../out/common/buffer/attributedata.d.ts": [ - "../../out/common/buffer/constants.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/buffer/bufferline.d.ts": [ - "../../out/common/buffer/attributedata.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/circularlist.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/coreterminal.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../out/common/inputhandler.d.ts", - "../../out/common/lifecycle.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/eventemitter.d.ts": [ - "../../src/common/types.d.ts" - ], - "../../out/common/inputhandler.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../out/common/lifecycle.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/lifecycle.d.ts": [ - "../../src/common/types.d.ts" - ], - "../../out/common/public/buffernamespaceapi.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/public/parserapi.d.ts": [ - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/public/unicodeapi.d.ts": [ - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/services/services.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/buffer/types.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/parser/types.d.ts": [ - "../../out/common/parser/constants.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/types.d.ts": [ - "../../out/common/circularlist.d.ts", - "../../out/common/eventemitter.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../src/headless/public/terminal.ts": [ - "../../out/common/eventemitter.d.ts", - "../../out/common/public/buffernamespaceapi.d.ts", - "../../out/common/public/parserapi.d.ts", - "../../out/common/public/unicodeapi.d.ts", - "../../src/headless/terminal.ts", - "../../typings/xterm-core.d.ts" - ], - "../../src/headless/terminal.ts": [ - "../../out/common/buffer/bufferline.d.ts", - "../../out/common/coreterminal.d.ts", - "../../out/common/eventemitter.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/headless/types.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ] - }, - "exportedModulesMap": { - "../../node_modules/@types/node/base.d.ts": [ - "../../node_modules/@types/node/assert.d.ts", - "../../node_modules/@types/node/ts3.6/base.d.ts" - ], - "../../node_modules/@types/node/child_process.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/cluster.d.ts": [ - "../../node_modules/@types/node/child_process.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/console.d.ts": [ - "../../node_modules/@types/node/util.d.ts" - ], - "../../node_modules/@types/node/constants.d.ts": [ - "../../node_modules/@types/node/crypto.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/os.d.ts" - ], - "../../node_modules/@types/node/crypto.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/dgram.d.ts": [ - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/domain.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/events.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/fs.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/fs/promises.d.ts": [ - "../../node_modules/@types/node/fs.d.ts" - ], - "../../node_modules/@types/node/http.d.ts": [ - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/http2.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/https.d.ts": [ - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/index.d.ts": [ - "../../node_modules/@types/node/base.d.ts" - ], - "../../node_modules/@types/node/inspector.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/module.d.ts": [ - "../../node_modules/@types/node/url.d.ts" - ], - "../../node_modules/@types/node/net.d.ts": [ - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/perf_hooks.d.ts": [ - "../../node_modules/@types/node/async_hooks.d.ts" - ], - "../../node_modules/@types/node/process.d.ts": [ - "../../node_modules/@types/node/tty.d.ts" - ], - "../../node_modules/@types/node/readline.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/repl.d.ts": [ - "../../node_modules/@types/node/readline.d.ts", - "../../node_modules/@types/node/util.d.ts", - "../../node_modules/@types/node/vm.d.ts" - ], - "../../node_modules/@types/node/stream.d.ts": [ - "../../node_modules/@types/node/events.d.ts" - ], - "../../node_modules/@types/node/tls.d.ts": [ - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/ts3.6/base.d.ts": [ - "../../node_modules/@types/node/async_hooks.d.ts", - "../../node_modules/@types/node/buffer.d.ts", - "../../node_modules/@types/node/child_process.d.ts", - "../../node_modules/@types/node/cluster.d.ts", - "../../node_modules/@types/node/console.d.ts", - "../../node_modules/@types/node/constants.d.ts", - "../../node_modules/@types/node/crypto.d.ts", - "../../node_modules/@types/node/dgram.d.ts", - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/domain.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/globals.d.ts", - "../../node_modules/@types/node/globals.global.d.ts", - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/http2.d.ts", - "../../node_modules/@types/node/https.d.ts", - "../../node_modules/@types/node/inspector.d.ts", - "../../node_modules/@types/node/module.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/os.d.ts", - "../../node_modules/@types/node/path.d.ts", - "../../node_modules/@types/node/perf_hooks.d.ts", - "../../node_modules/@types/node/process.d.ts", - "../../node_modules/@types/node/punycode.d.ts", - "../../node_modules/@types/node/querystring.d.ts", - "../../node_modules/@types/node/readline.d.ts", - "../../node_modules/@types/node/repl.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/string_decoder.d.ts", - "../../node_modules/@types/node/timers.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/trace_events.d.ts", - "../../node_modules/@types/node/tty.d.ts", - "../../node_modules/@types/node/url.d.ts", - "../../node_modules/@types/node/util.d.ts", - "../../node_modules/@types/node/v8.d.ts", - "../../node_modules/@types/node/vm.d.ts", - "../../node_modules/@types/node/wasi.d.ts", - "../../node_modules/@types/node/worker_threads.d.ts", - "../../node_modules/@types/node/zlib.d.ts" - ], - "../../node_modules/@types/node/tty.d.ts": [ - "../../node_modules/@types/node/net.d.ts" - ], - "../../node_modules/@types/node/url.d.ts": [ - "../../node_modules/@types/node/querystring.d.ts" - ], - "../../node_modules/@types/node/v8.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../node_modules/@types/node/worker_threads.d.ts": [ - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/url.d.ts", - "../../node_modules/@types/node/vm.d.ts" - ], - "../../node_modules/@types/node/zlib.d.ts": [ - "../../node_modules/@types/node/stream.d.ts" - ], - "../../out/common/buffer/attributedata.d.ts": [ - "../../out/common/buffer/constants.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/buffer/bufferline.d.ts": [ - "../../out/common/buffer/attributedata.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/circularlist.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/coreterminal.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../out/common/inputhandler.d.ts", - "../../out/common/lifecycle.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/eventemitter.d.ts": [ - "../../src/common/types.d.ts" - ], - "../../out/common/inputhandler.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../out/common/lifecycle.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../out/common/lifecycle.d.ts": [ - "../../src/common/types.d.ts" - ], - "../../out/common/public/buffernamespaceapi.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/public/parserapi.d.ts": [ - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/public/unicodeapi.d.ts": [ - "../../src/common/types.d.ts", - "../../typings/xterm.d.ts" - ], - "../../out/common/services/services.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/buffer/types.d.ts": [ - "../../src/common/eventemitter.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/parser/types.d.ts": [ - "../../src/common/parser/constants.ts", - "../../src/common/types.d.ts" - ], - "../../src/common/types.d.ts": [ - "../../src/common/buffer/types.d.ts", - "../../src/common/circularlist.ts", - "../../src/common/eventemitter.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/services/services.ts", - "../../typings/xterm.d.ts" - ], - "../../src/headless/public/terminal.ts": [ - "../../out/common/eventemitter.d.ts", - "../../typings/xterm-core.d.ts" - ], - "../../src/headless/terminal.ts": [ - "../../out/common/coreterminal.d.ts", - "../../out/common/eventemitter.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/types.d.ts" - ], - "../../src/headless/types.d.ts": [ - "../../out/common/eventemitter.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../node_modules/@types/mocha/index.d.ts", - "../../node_modules/@types/node/assert.d.ts", - "../../node_modules/@types/node/async_hooks.d.ts", - "../../node_modules/@types/node/base.d.ts", - "../../node_modules/@types/node/buffer.d.ts", - "../../node_modules/@types/node/child_process.d.ts", - "../../node_modules/@types/node/cluster.d.ts", - "../../node_modules/@types/node/console.d.ts", - "../../node_modules/@types/node/constants.d.ts", - "../../node_modules/@types/node/crypto.d.ts", - "../../node_modules/@types/node/dgram.d.ts", - "../../node_modules/@types/node/dns.d.ts", - "../../node_modules/@types/node/domain.d.ts", - "../../node_modules/@types/node/events.d.ts", - "../../node_modules/@types/node/fs.d.ts", - "../../node_modules/@types/node/fs/promises.d.ts", - "../../node_modules/@types/node/globals.d.ts", - "../../node_modules/@types/node/globals.global.d.ts", - "../../node_modules/@types/node/http.d.ts", - "../../node_modules/@types/node/http2.d.ts", - "../../node_modules/@types/node/https.d.ts", - "../../node_modules/@types/node/index.d.ts", - "../../node_modules/@types/node/inspector.d.ts", - "../../node_modules/@types/node/module.d.ts", - "../../node_modules/@types/node/net.d.ts", - "../../node_modules/@types/node/os.d.ts", - "../../node_modules/@types/node/path.d.ts", - "../../node_modules/@types/node/perf_hooks.d.ts", - "../../node_modules/@types/node/process.d.ts", - "../../node_modules/@types/node/punycode.d.ts", - "../../node_modules/@types/node/querystring.d.ts", - "../../node_modules/@types/node/readline.d.ts", - "../../node_modules/@types/node/repl.d.ts", - "../../node_modules/@types/node/stream.d.ts", - "../../node_modules/@types/node/string_decoder.d.ts", - "../../node_modules/@types/node/timers.d.ts", - "../../node_modules/@types/node/tls.d.ts", - "../../node_modules/@types/node/trace_events.d.ts", - "../../node_modules/@types/node/ts3.6/base.d.ts", - "../../node_modules/@types/node/tty.d.ts", - "../../node_modules/@types/node/url.d.ts", - "../../node_modules/@types/node/util.d.ts", - "../../node_modules/@types/node/v8.d.ts", - "../../node_modules/@types/node/vm.d.ts", - "../../node_modules/@types/node/wasi.d.ts", - "../../node_modules/@types/node/worker_threads.d.ts", - "../../node_modules/@types/node/zlib.d.ts", - "../../node_modules/typescript/lib/lib.dom.d.ts", - "../../node_modules/typescript/lib/lib.es2015.collection.d.ts", - "../../node_modules/typescript/lib/lib.es2015.core.d.ts", - "../../node_modules/typescript/lib/lib.es2015.d.ts", - "../../node_modules/typescript/lib/lib.es2015.generator.d.ts", - "../../node_modules/typescript/lib/lib.es2015.iterable.d.ts", - "../../node_modules/typescript/lib/lib.es2015.promise.d.ts", - "../../node_modules/typescript/lib/lib.es2015.proxy.d.ts", - "../../node_modules/typescript/lib/lib.es2015.reflect.d.ts", - "../../node_modules/typescript/lib/lib.es2015.symbol.d.ts", - "../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", - "../../node_modules/typescript/lib/lib.es2016.array.include.d.ts", - "../../node_modules/typescript/lib/lib.es2016.d.ts", - "../../node_modules/typescript/lib/lib.es2017.d.ts", - "../../node_modules/typescript/lib/lib.es2017.intl.d.ts", - "../../node_modules/typescript/lib/lib.es2017.object.d.ts", - "../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", - "../../node_modules/typescript/lib/lib.es2017.string.d.ts", - "../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", - "../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts", - "../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts", - "../../node_modules/typescript/lib/lib.es2018.d.ts", - "../../node_modules/typescript/lib/lib.es2018.intl.d.ts", - "../../node_modules/typescript/lib/lib.es2018.promise.d.ts", - "../../node_modules/typescript/lib/lib.es2018.regexp.d.ts", - "../../node_modules/typescript/lib/lib.es2020.bigint.d.ts", - "../../node_modules/typescript/lib/lib.es5.d.ts", - "../../node_modules/typescript/lib/lib.esnext.intl.d.ts", - "../../out/common/buffer/attributedata.d.ts", - "../../out/common/buffer/bufferline.d.ts", - "../../out/common/buffer/constants.d.ts", - "../../out/common/circularlist.d.ts", - "../../out/common/coreterminal.d.ts", - "../../out/common/eventemitter.d.ts", - "../../out/common/inputhandler.d.ts", - "../../out/common/lifecycle.d.ts", - "../../out/common/parser/constants.d.ts", - "../../out/common/public/buffernamespaceapi.d.ts", - "../../out/common/public/parserapi.d.ts", - "../../out/common/public/unicodeapi.d.ts", - "../../out/common/services/services.d.ts", - "../../src/common/buffer/types.d.ts", - "../../src/common/parser/types.d.ts", - "../../src/common/types.d.ts", - "../../src/headless/public/terminal.ts", - "../../src/headless/terminal.ts", - "../../src/headless/types.d.ts", - "../../typings/xterm-core.d.ts", - "../../typings/xterm.d.ts" - ] - }, - "version": "4.2.4" -} \ No newline at end of file diff --git a/headless/headless/types.d.ts b/headless/headless/types.d.ts deleted file mode 100644 index a35f3988..00000000 --- a/headless/headless/types.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { IBuffer, IBufferSet } from 'common/buffer/Types'; -import { IEvent } from 'common/EventEmitter'; -import { IFunctionIdentifier, IParams } from 'common/parser/Types'; -import { ICoreTerminal, IDisposable, IMarker, ITerminalOptions } from 'common/Types'; -export interface ITerminal extends ICoreTerminal { - rows: number; - cols: number; - buffer: IBuffer; - buffers: IBufferSet; - markers: IMarker[]; - options: ITerminalOptions; - onCursorMove: IEvent; - onData: IEvent; - onBinary: IEvent; - onLineFeed: IEvent; - onResize: IEvent<{ - cols: number; - rows: number; - }>; - onTitleChange: IEvent; - resize(columns: number, rows: number): void; - addCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean): IDisposable; - addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean): IDisposable; - addEscHandler(id: IFunctionIdentifier, callback: () => boolean): IDisposable; - addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; - addMarker(cursorYOffset: number): IMarker | undefined; - dispose(): void; - clear(): void; - write(data: string | Uint8Array, callback?: () => void): void; - reset(): void; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/headless/headless/types.d.ts.map b/headless/headless/types.d.ts.map deleted file mode 100644 index 7410b043..00000000 --- a/headless/headless/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/headless/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB,OAAO,EAAE,gBAAgB,CAAC;IAE1B,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,GAAG,WAAW,CAAC;IAC5F,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,WAAW,CAAC;IACzG,aAAa,CAAC,EAAE,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,GAAG,WAAW,CAAC;IAC7E,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,WAAW,CAAC;IAC/E,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtD,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC9D,KAAK,IAAI,IAAI,CAAC;CACf"} \ No newline at end of file diff --git a/headless/headless/types.js b/headless/headless/types.js deleted file mode 100644 index 11e638d1..00000000 --- a/headless/headless/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/headless/headless/types.js.map b/headless/headless/types.js.map deleted file mode 100644 index d651a6aa..00000000 --- a/headless/headless/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/headless/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/headless/tsconfig.json b/src/headless/tsconfig.json index 268bdbdd..39f71bda 100644 --- a/src/headless/tsconfig.json +++ b/src/headless/tsconfig.json @@ -5,13 +5,12 @@ "es2015", "es2016.Array.Include" ], - "outDir": "../../headless", // Temporary outdir to avoid collisions with 'xterm' + "outDir": "../../out/headless", // Temporary outdir to avoid collisions with 'xterm' "types": [ "../../node_modules/@types/mocha", "../../node_modules/@types/node" ], "baseUrl": "../", - "extendedDiagnostics": true, "paths": { "common/*": [ "./common/*" ] } From 9b2e511bcb911e678ddd57963d5342ac62d944b2 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:57:21 -0700 Subject: [PATCH 09/42] Fix webpack headless --- .gitignore | 1 + node-test/README.md | 4 ++-- src/headless/tsconfig.json | 2 +- webpack.config.headless.js | 41 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 webpack.config.headless.js diff --git a/.gitignore b/.gitignore index 8aea04b2..4958559e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ *.swp .lock-wscript lib/ +lib-headless/ out/ out-test/ .nyc_output/ diff --git a/node-test/README.md b/node-test/README.md index b7a67aeb..0da50146 100644 --- a/node-test/README.md +++ b/node-test/README.md @@ -2,8 +2,8 @@ Cursory test that 'xterm-core' works: ``` # From root of this repo -npm run compile # Outputs to xterm-core -npx webpack --config webpack.config.core.js # Outputs to lib +npm run compile # Outputs to out/headless +npx webpack --config webpack.config.headless.js # Outputs to lib cd node-test npm link ../lib/ node index.js diff --git a/src/headless/tsconfig.json b/src/headless/tsconfig.json index 39f71bda..6085a07f 100644 --- a/src/headless/tsconfig.json +++ b/src/headless/tsconfig.json @@ -5,7 +5,7 @@ "es2015", "es2016.Array.Include" ], - "outDir": "../../out/headless", // Temporary outdir to avoid collisions with 'xterm' + "outDir": "../../out", "types": [ "../../node_modules/@types/mocha", "../../node_modules/@types/node" diff --git a/webpack.config.headless.js b/webpack.config.headless.js new file mode 100644 index 00000000..2010e190 --- /dev/null +++ b/webpack.config.headless.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019 The xterm.js authors. All rights reserved. + * @license MIT + */ + +const path = require('path'); + +/** + * This webpack config does a production build for xterm.js. It works by taking the output from tsc + * (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a + * production mode umd library module in `lib/`. The aliases are used fix up the absolute paths + * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. + */ +module.exports = { + entry: './out/headless/public/Terminal.js', + devtool: 'source-map', + module: { + rules: [ + { + test: /\.js$/, + use: ["source-map-loader"], + enforce: "pre", + exclude: /node_modules/ + } + ] + }, + resolve: { + modules: ['./node_modules'], + extensions: [ '.js' ], + alias: { + common: path.resolve('./out/common'), + headless: path.resolve('./out/headless') + } + }, + output: { + filename: 'xterm.js', + path: path.resolve('./lib-headless'), + libraryTarget: 'umd' + }, + mode: 'production' +}; From 2191d1a16aece69d507e1048a530d5301e54e807 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:01:20 -0700 Subject: [PATCH 10/42] Output commonjs for headless --- webpack.config.headless.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webpack.config.headless.js b/webpack.config.headless.js index 2010e190..7ae66676 100644 --- a/webpack.config.headless.js +++ b/webpack.config.headless.js @@ -35,7 +35,9 @@ module.exports = { output: { filename: 'xterm.js', path: path.resolve('./lib-headless'), - libraryTarget: 'umd' + library: { + type: 'commonjs' + } }, mode: 'production' }; From 01babd149120ec46e0721e60b7d09dc31099bd3f Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:11:56 -0700 Subject: [PATCH 11/42] Do a pass of headless/Terminal members --- src/browser/Terminal.ts | 4 ++-- src/headless/Terminal.ts | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/browser/Terminal.ts b/src/browser/Terminal.ts index 5aed701a..004f2314 100644 --- a/src/browser/Terminal.ts +++ b/src/browser/Terminal.ts @@ -113,8 +113,8 @@ export class Terminal extends CoreTerminal implements ITerminal { public get onSelectionChange(): IEvent { return this._onSelectionChange.event; } private _onTitleChange = new EventEmitter(); public get onTitleChange(): IEvent { return this._onTitleChange.event; } - private _onBell = new EventEmitter(); - public get onBell (): IEvent { return this._onBell.event; } + private _onBell = new EventEmitter(); + public get onBell(): IEvent { return this._onBell.event; } private _onFocus = new EventEmitter(); public get onFocus(): IEvent { return this._onFocus.event; } diff --git a/src/headless/Terminal.ts b/src/headless/Terminal.ts index 4011adb9..7f138ce1 100644 --- a/src/headless/Terminal.ts +++ b/src/headless/Terminal.ts @@ -32,9 +32,8 @@ export class Terminal extends CoreTerminal { // TODO: We should remove options once components adopt optionsService public get options(): IInitializedTerminalOptions { return this.optionsService.options; } - - private _onBell = new EventEmitter(); - public get onBell (): IEvent { return this._onBell.event; } + private _onBell = new EventEmitter(); + public get onBell(): IEvent { return this._onBell.event; } private _onCursorMove = new EventEmitter(); public get onCursorMove(): IEvent { return this._onCursorMove.event; } private _onTitleChange = new EventEmitter(); @@ -88,6 +87,17 @@ export class Terminal extends CoreTerminal { return this.buffers.active; } + protected _updateOptions(key: string): void { + super._updateOptions(key); + + // TODO: These listeners should be owned by individual components + switch (key) { + case 'tabStopWidth': this.buffers.setupTabStops(); break; + } + } + + // TODO: Support paste here? + public get markers(): IMarker[] { return this.buffer.markers; } From 40992a7f76d1732c0bf67b7ad3f7e579aad385b3 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:18:07 -0700 Subject: [PATCH 12/42] Update node test --- node-test/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node-test/index.js b/node-test/index.js index 19bff5dc..7be332be 100644 --- a/node-test/index.js +++ b/node-test/index.js @@ -1,12 +1,12 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); -const xterm = require('xterm-core'); +const Terminal = require('../lib-headless/xterm.js').Terminal; console.log('Creating xterm-core terminal...'); -const terminal = new xterm.Terminal(); +const terminal = new Terminal(); console.log('Writing `ls` to terminal...') -terminal.write('ls', () => { +terminal.write('foo \x1b[1;31mbar\x1b[0m baz', () => { const bufferLine = terminal.buffer.normal.getLine(terminal.buffer.normal.cursorY); - const contents = bufferLine.translateToString(); - console.log(`Contents of terminal active buffer are: ${contents}`); // ls + const contents = bufferLine.translateToString(true); + console.log(`Contents of terminal active buffer are: ${contents}`); // foo bar baz }); From a6e6c07a3c2983535389f971ff9102f2764cbdc7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:23:04 -0700 Subject: [PATCH 13/42] Add first headless test --- node-test/index.js | 2 +- src/headless/Terminal.test.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/headless/Terminal.test.ts diff --git a/node-test/index.js b/node-test/index.js index 7be332be..2fd8da7f 100644 --- a/node-test/index.js +++ b/node-test/index.js @@ -4,7 +4,7 @@ const Terminal = require('../lib-headless/xterm.js').Terminal; console.log('Creating xterm-core terminal...'); const terminal = new Terminal(); -console.log('Writing `ls` to terminal...') +console.log('Writing to terminal...') terminal.write('foo \x1b[1;31mbar\x1b[0m baz', () => { const bufferLine = terminal.buffer.normal.getLine(terminal.buffer.normal.cursorY); const contents = bufferLine.translateToString(true); diff --git a/src/headless/Terminal.test.ts b/src/headless/Terminal.test.ts new file mode 100644 index 00000000..07f90436 --- /dev/null +++ b/src/headless/Terminal.test.ts @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2016 The xterm.js authors. All rights reserved. + * @license MIT + */ + +import { deepStrictEqual, throws } from 'assert'; +import { Terminal } from 'headless/public/Terminal'; + +const INIT_COLS = 80; +const INIT_ROWS = 24; + +describe('Headless Terminal', () => { + let term: Terminal; + const termOptions = { + cols: INIT_COLS, + rows: INIT_ROWS + }; + + beforeEach(() => { + term = new Terminal(termOptions); + }); + + it('should throw when trying to change cols or rows', () => { + throws(() => term.setOption('cols', 1000)); + throws(() => term.setOption('rows', 1000)); + }); +}); From 4c4160ae0324ba1f658b051062299a33b3195cfd Mon Sep 17 00:00:00 2001 From: Erik Welander Date: Wed, 4 Aug 2021 11:31:32 -0700 Subject: [PATCH 14/42] Add missing escape Previously the \ was unnecessarily escaping the ';'. --- addons/xterm-addon-search/src/SearchAddon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/xterm-addon-search/src/SearchAddon.ts b/addons/xterm-addon-search/src/SearchAddon.ts index 4a73d998..1409328d 100644 --- a/addons/xterm-addon-search/src/SearchAddon.ts +++ b/addons/xterm-addon-search/src/SearchAddon.ts @@ -23,7 +23,7 @@ export interface ISearchResult { row: number; } -const NON_WORD_CHARACTERS = ' ~!@#$%^&*()+`-=[]{}|\;:"\',./<>?'; +const NON_WORD_CHARACTERS = ' ~!@#$%^&*()+`-=[]{}|\\;:"\',./<>?'; const LINES_CACHE_TIME_TO_LIVE = 15 * 1000; // 15 secs export class SearchAddon implements ITerminalAddon { From a48cffd4ab60f9e17c594cbb86f3d9f6fb0718bb Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Mon, 9 Aug 2021 18:53:04 -0700 Subject: [PATCH 15/42] Add HashiCorp Nomad to the real world uses list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The equivalent of https://github.com/xtermjs/xtermjs.org/pull/149 but in the right place this time 🙂 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0ac211ed..9d926afe 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ Xterm.js is used in several world-class applications to provide great terminal e - [**Wizard Assistant**](https://wizardassistant.com/): Wizard Assistant comes with advanced automation tools, preloaded common and special time-saving commands, and a built-in SSH terminal. Now you can remotely administer, troubleshoot, and analyze any system with ease. - [**ucli**](https://github.com/tsadarsh/ucli): Command Line for everyone :family_man_woman_girl_boy: at [www.ucli.tech](https://www.ucli.tech). - [**Tess**](https://github.com/SquitchYT/Tess/): Simple Terminal Fully Customizable for Everyone. +- [**HashiCorp Nomad**](https://www.nomadproject.io/): A container orchestrator with the ability to connect to remote tasks via a web interface using websockets and xterm.js. - [And much more...](https://github.com/xtermjs/xterm.js/network/dependents) Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it on our list. Note: Please add any new contributions to the end of the list only. From f43fcafc9925bc917f0fa23eb0b27abc828a10e4 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 05:08:03 -0700 Subject: [PATCH 16/42] Move addon manager to common and use in xterm-core --- src/browser/public/Terminal.ts | 6 +- .../public/AddonManager.test.ts | 0 .../public/AddonManager.ts | 0 src/headless/public/Terminal.ts | 10 +- typings/xterm-core.d.ts | 227 +++++++++--------- 5 files changed, 128 insertions(+), 115 deletions(-) rename src/{browser => common}/public/AddonManager.test.ts (100%) rename src/{browser => common}/public/AddonManager.ts (100%) diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index adfee544..8b7b5d2e 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -5,12 +5,12 @@ import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, FontWeight } from 'xterm'; import { ITerminal } from 'browser/Types'; -import { Terminal as TerminalCore } from '../Terminal'; -import * as Strings from '../LocalizableStrings'; +import { Terminal as TerminalCore } from 'browser/Terminal'; +import * as Strings from 'browser/LocalizableStrings'; import { IEvent } from 'common/EventEmitter'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; -import { AddonManager } from './AddonManager'; +import { AddonManager } from 'common/public/AddonManager'; import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; export class Terminal implements ITerminalApi { diff --git a/src/browser/public/AddonManager.test.ts b/src/common/public/AddonManager.test.ts similarity index 100% rename from src/browser/public/AddonManager.test.ts rename to src/common/public/AddonManager.test.ts diff --git a/src/browser/public/AddonManager.ts b/src/common/public/AddonManager.ts similarity index 100% rename from src/browser/public/AddonManager.ts rename to src/common/public/AddonManager.ts diff --git a/src/headless/public/Terminal.ts b/src/headless/public/Terminal.ts index 4b27a04b..44f9753a 100644 --- a/src/headless/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -7,16 +7,19 @@ import { IEvent } from 'common/EventEmitter'; import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; -import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; +import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalAddon, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; import { Terminal as TerminalCore } from 'headless/Terminal'; +import { AddonManager } from 'common/public/AddonManager'; export class Terminal implements ITerminalApi { private _core: TerminalCore; + private _addonManager: AddonManager; private _parser: IParser | undefined; private _buffer: BufferNamespaceApi | undefined; constructor(options?: ITerminalOptions) { this._core = new TerminalCore(options); + this._addonManager = new AddonManager(); } private _checkProposedApi(): void { @@ -69,6 +72,7 @@ export class Terminal implements ITerminalApi { return this.registerMarker(cursorYOffset); } public dispose(): void { + this._addonManager.dispose(); this._core.dispose(); } public clear(): void { @@ -106,6 +110,10 @@ export class Terminal implements ITerminalApi { public reset(): void { this._core.reset(); } + public loadAddon(addon: ITerminalAddon): void { + // TODO: This could cause issues if the addon calls renderer apis + return this._addonManager.loadAddon(this as any, addon); + } private _verifyIntegers(...values: number[]): void { for (const value of values) { diff --git a/typings/xterm-core.d.ts b/typings/xterm-core.d.ts index 06964ca0..eabb51fc 100644 --- a/typings/xterm-core.d.ts +++ b/typings/xterm-core.d.ts @@ -12,7 +12,7 @@ declare module 'xterm-core' { * A string representing log level. */ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off'; - + /** * An object containing start up options for the terminal. */ @@ -23,7 +23,7 @@ declare module 'xterm-core' { * true currently, but will change to false in v5.0. */ allowProposedApi?: boolean; - + /** * Whether background should support non-opaque color. It must be set before * executing the `Terminal.open()` method and can't be changed later without @@ -31,23 +31,23 @@ declare module 'xterm-core' { * performance. */ allowTransparency?: boolean; - + /** * If enabled, alt + click will move the prompt cursor to position * underneath the mouse. The default is true. */ altClickMovesCursor?: boolean; - + /** * A data uri of the sound to use for the bell when `bellStyle = 'sound'`. */ bellSound?: string; - + /** * The type of the bell notification the terminal will use. */ bellStyle?: 'none' | 'sound'; - + /** * When enabled the cursor will be set to the beginning of the next line * with every new line. This is equivalent to sending '\r\n' for each '\n'. @@ -57,59 +57,59 @@ declare module 'xterm-core' { * useful. */ convertEol?: boolean; - + /** * The number of columns in the terminal. */ cols?: number; - + /** * Whether the cursor blinks. */ cursorBlink?: boolean; - + /** * The style of the cursor. */ cursorStyle?: 'block' | 'underline' | 'bar'; - + /** * The width of the cursor in CSS pixels when `cursorStyle` is set to 'bar'. */ cursorWidth?: number; - + /** * Whether input should be disabled. */ disableStdin?: boolean; - + /** * Whether to draw bold text in bright colors. The default is true. */ drawBoldTextInBrightColors?: boolean; - + /** * The modifier key hold to multiply scroll speed. */ fastScrollModifier?: 'alt' | 'ctrl' | 'shift' | undefined; - + /** * The spacing in whole pixels between characters. */ letterSpacing?: number; - + /** * The line height used to render text. */ lineHeight?: number; - + /** * The duration in milliseconds before link tooltip events fire when * hovering on a link. * @deprecated This will be removed when the link matcher API is removed. */ linkTooltipHoverDuration?: number; - + /** * What log level to use, this will log for all levels below and including * what is set: @@ -121,12 +121,12 @@ declare module 'xterm-core' { * 5. off */ logLevel?: LogLevel; - + /** * Whether to treat option as the meta key. */ macOptionIsMeta?: boolean; - + /** * Whether holding a modifier key will force normal selection behavior, * regardless of whether the terminal is in mouse events mode. This will @@ -135,7 +135,7 @@ declare module 'xterm-core' { * with mouse mode enabled. */ macOptionClickForcesSelection?: boolean; - + /** * The minimum contrast ratio for text in the terminal, setting this will * change the foreground color dynamically depending on whether the contrast @@ -147,47 +147,47 @@ declare module 'xterm-core' { * - 21: White on black or black on white. */ minimumContrastRatio?: number; - + /** * Whether to select the word under the cursor on right click, this is * standard behavior in a lot of macOS applications. */ rightClickSelectsWord?: boolean; - + /** * The number of rows in the terminal. */ rows?: number; - + /** * Whether screen reader support is enabled. When on this will expose * supporting elements in the DOM to support NVDA on Windows and VoiceOver * on macOS. */ screenReaderMode?: boolean; - + /** * The amount of scrollback in the terminal. Scrollback is the amount of * rows that are retained when lines are scrolled beyond the initial * viewport. */ scrollback?: number; - + /** * The scrolling speed multiplier used for adjusting normal scrolling speed. */ scrollSensitivity?: number; - + /** * The size of tab stops in the terminal. */ tabStopWidth?: number; - + /** * The color theme of the terminal. */ theme?: ITheme; - + /** * Whether "Windows mode" is enabled. Because Windows backends winpty and * conpty operate by doing line wrapping on their side, xterm.js does not @@ -199,20 +199,20 @@ declare module 'xterm-core' { * not whitespace. */ windowsMode?: boolean; - + /** * A string containing all characters that are considered word separated by the * double click to select work logic. */ wordSeparator?: string; - + /** * Enable various window manipulation and report features. * All features are disabled by default for security reasons. */ windowOptions?: IWindowOptions; } - + /** * Contains colors to theme the terminal with. */ @@ -260,14 +260,14 @@ declare module 'xterm-core' { /** ANSI bright white (eg. `\x1b[1;37m`) */ brightWhite?: string; } - + /** * An object that can be disposed via a dispose function. */ export interface IDisposable { dispose(): void; } - + /** * An event that can be listened to. * @returns an `IDisposable` to stop listening. @@ -275,7 +275,7 @@ declare module 'xterm-core' { export interface IEvent { (listener: (arg1: T, arg2: U) => any): IDisposable; } - + /** * Represents a specific line in the terminal that is tracked when scrollback * is trimmed and lines are added or removed. This is a single line that may @@ -286,18 +286,18 @@ declare module 'xterm-core' { * A unique identifier for this marker. */ readonly id: number; - + /** * Whether this marker is disposed. */ readonly isDisposed: boolean; - + /** * The actual line index in the buffer at this point in time. This is set to * -1 if the marker has been disposed. */ readonly line: number; - + /** * Event listener to get notified when the marker gets disposed. Automatic disposal * might happen for a marker, that got invalidated by scrolling out or removal of @@ -305,7 +305,7 @@ declare module 'xterm-core' { */ onDispose: IEvent; } - + /** * The set of localizable strings. */ @@ -314,14 +314,14 @@ declare module 'xterm-core' { * The aria label for the underlying input textarea for the terminal. */ promptLabel: string; - + /** * Announcement for when line reading is suppressed due to too many lines * being printed to the terminal when `screenReaderMode` is enabled. */ tooMuchOutput: string; } - + /** * Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t). * @@ -477,7 +477,7 @@ declare module 'xterm-core' { */ setWinLines?: boolean; } - + /** * The class that represents an xterm.js terminal. */ @@ -488,51 +488,51 @@ declare module 'xterm-core' { * `Terminal.resize` for when the terminal exists. */ readonly rows: number; - + /** * The number of columns in the terminal's viewport. Use * `ITerminalOptions.cols` to set this in the constructor and * `Terminal.resize` for when the terminal exists. */ readonly cols: number; - + /** * (EXPERIMENTAL) The terminal's current buffer, this might be either the * normal buffer or the alt buffer depending on what's running in the * terminal. */ readonly buffer: IBufferNamespace; - + /** * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt * buffer is active this will always return []. */ readonly markers: ReadonlyArray; - + /** * (EXPERIMENTAL) Get the parser interface to register * custom escape sequence handlers. */ readonly parser: IParser; - + /** * (EXPERIMENTAL) Get the Unicode handling interface * to register and switch Unicode version. */ readonly unicode: IUnicodeHandling; - + /** * Natural language strings that can be localized. */ static strings: ILocalizableStrings; - + /** * Creates a new `Terminal` object. * * @param options An object containing a set of options. */ constructor(options?: ITerminalOptions); - + /** * Adds an event listener for when a binary event fires. This is used to * enable non UTF-8 conformant binary messages to be sent to the backend. @@ -543,13 +543,13 @@ declare module 'xterm-core' { * @returns an `IDisposable` to stop listening. */ onBinary: IEvent; - + /** * Adds an event listener for the cursor moves. * @returns an `IDisposable` to stop listening. */ onCursorMove: IEvent; - + /** * Adds an event listener for when a data event fires. This happens for * example when the user types or pastes into the terminal. The event value @@ -558,20 +558,20 @@ declare module 'xterm-core' { * @returns an `IDisposable` to stop listening. */ onData: IEvent; - + /** * Adds an event listener for when a line feed is added. * @returns an `IDisposable` to stop listening. */ onLineFeed: IEvent; - + /** * Adds an event listener for when the terminal is resized. The event value * contains the new size. * @returns an `IDisposable` to stop listening. */ onResize: IEvent<{ cols: number, rows: number }>; - + /** * Adds an event listener for when an OSC 0 or OSC 2 title change occurs. * The event value is the new title. @@ -595,7 +595,7 @@ declare module 'xterm-core' { * @returns The new marker or undefined. */ registerMarker(cursorYOffset: number): IMarker | undefined; - + /** * @deprecated use `registerMarker` instead. */ @@ -611,7 +611,7 @@ declare module 'xterm-core' { * Clear the entire buffer, making the prompt line the new first line. */ clear(): void; - + /** * Write data to the terminal. * @param data The data to write to the terminal. This can either be raw @@ -621,7 +621,7 @@ declare module 'xterm-core' { * by the parser. */ write(data: string | Uint8Array, callback?: () => void): void; - + /** * Writes data to the terminal, followed by a break line character (\n). * @param data The data to write to the terminal. This can either be raw @@ -631,7 +631,7 @@ declare module 'xterm-core' { * by the parser. */ writeln(data: string | Uint8Array, callback?: () => void): void; - + /** * Write UTF8 data to the terminal. * @param data The data to write to the terminal. @@ -639,7 +639,7 @@ declare module 'xterm-core' { * @deprecated use `write` instead */ writeUtf8(data: Uint8Array, callback?: () => void): void; - + /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -660,7 +660,7 @@ declare module 'xterm-core' { * @param key The option key. */ getOption(key: string): any; - + /** * Sets an option on the terminal. * @param key The option key. @@ -721,13 +721,19 @@ declare module 'xterm-core' { * @param value The option value. */ setOption(key: string, value: any): void; - + /** * Perform a full reset (RIS, aka '\x1bc'). */ reset(): void; + + /** + * Loads an addon into this instance of xterm.js. + * @param addon The addon to load. + */ + loadAddon(addon: ITerminalAddon): void; } - + /** * An addon that can provide additional functionality to the terminal. */ @@ -737,7 +743,7 @@ declare module 'xterm-core' { */ activate(terminal: Terminal): void; } - + /** * An object representing a selection within the terminal. */ @@ -746,23 +752,23 @@ declare module 'xterm-core' { * The start column of the selection. */ startColumn: number; - + /** * The start row of the selection. */ startRow: number; - + /** * The end column of the selection. */ endColumn: number; - + /** * The end row of the selection. */ endRow: number; } - + /** * An object representing a range within the viewport of the terminal. */ @@ -771,13 +777,13 @@ declare module 'xterm-core' { * The start of the range. */ start: IViewportRangePosition; - + /** * The end of the range. */ end: IViewportRangePosition; } - + /** * An object representing a cell position within the viewport of the terminal. */ @@ -790,14 +796,14 @@ declare module 'xterm-core' { * a text editor. */ x: number; - + /** * The y position of the cell. This is a 0-based index that refers to a * specific row. */ y: number; } - + /** * A range within a buffer. */ @@ -806,13 +812,13 @@ declare module 'xterm-core' { * The start position of the range. */ start: IBufferCellPosition; - + /** * The end position of the range. */ end: IBufferCellPosition; } - + /** * A position within a buffer. */ @@ -821,13 +827,13 @@ declare module 'xterm-core' { * The x position within the buffer. */ x: number; - + /** * The y position within the buffer. */ y: number; } - + /** * Represents a terminal buffer. */ @@ -836,36 +842,36 @@ declare module 'xterm-core' { * The type of the buffer. */ readonly type: 'normal' | 'alternate'; - + /** * The y position of the cursor. This ranges between `0` (when the * cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the * last row). */ readonly cursorY: number; - + /** * The x position of the cursor. This ranges between `0` (left side) and * `Terminal.cols` (after last cell of the row). */ readonly cursorX: number; - + /** * The line within the buffer where the top of the viewport is. */ readonly viewportY: number; - + /** * The line within the buffer where the top of the bottom page is (when * fully scrolled down). */ readonly baseY: number; - + /** * The amount of lines in the buffer. */ readonly length: number; - + /** * Gets a line from the buffer, or undefined if the line index does not * exist. @@ -877,7 +883,7 @@ declare module 'xterm-core' { * @param y The line index to get. */ getLine(y: number): IBufferLine | undefined; - + /** * Creates an empty cell object suitable as a cell reference in * `line.getCell(x, cell)`. Use this to avoid costly recreation of @@ -885,7 +891,7 @@ declare module 'xterm-core' { */ getNullCell(): IBufferCell; } - + /** * Represents the terminal's set of buffers. */ @@ -894,25 +900,25 @@ declare module 'xterm-core' { * The active buffer, this will either be the normal or alternate buffers. */ readonly active: IBuffer; - + /** * The normal buffer. */ readonly normal: IBuffer; - + /** * The alternate buffer, this becomes the active buffer when an application * enters this mode via DECSET (`CSI ? 4 7 h`) */ readonly alternate: IBuffer; - + /** * Adds an event listener for when the active buffer changes. * @returns an `IDisposable` to stop listening. */ onBufferChange: IEvent; } - + /** * Represents a line in the terminal's buffer. */ @@ -921,13 +927,13 @@ declare module 'xterm-core' { * Whether the line is wrapped from the previous line. */ readonly isWrapped: boolean; - + /** * The length of the line, all call to getCell beyond the length will result * in `undefined`. */ readonly length: number; - + /** * Gets a cell from the line, or undefined if the line index does not exist. * @@ -941,7 +947,7 @@ declare module 'xterm-core' { * looped over to avoid creating new objects for every cell. */ getCell(x: number, cell?: IBufferCell): IBufferCell | undefined; - + /** * Gets the line as a string. Note that this is gets only the string for the * line, not taking isWrapped into account. @@ -952,7 +958,7 @@ declare module 'xterm-core' { */ translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string; } - + /** * Represents a single cell in the terminal's buffer. */ @@ -965,7 +971,7 @@ declare module 'xterm-core' { * - `0` for cells immediately following cells with a width of `2`. */ getWidth(): number; - + /** * The character(s) within the cell. Examples of what this can contain: * @@ -974,13 +980,13 @@ declare module 'xterm-core' { * - An emoji */ getChars(): string; - + /** * Gets the UTF32 codepoint of single characters, if content is a combined * string it returns the codepoint of the last character in the string. */ getCode(): number; - + /** * Gets the number representation of the foreground color mode, this can be * used to perform quick comparisons of 2 cells to see if they're the same. @@ -988,7 +994,7 @@ declare module 'xterm-core' { * a cell is. */ getFgColorMode(): number; - + /** * Gets the number representation of the background color mode, this can be * used to perform quick comparisons of 2 cells to see if they're the same. @@ -996,7 +1002,7 @@ declare module 'xterm-core' { * a cell is. */ getBgColorMode(): number; - + /** * Gets a cell's foreground color number, this differs depending on what the * color mode of the cell is: @@ -1009,7 +1015,7 @@ declare module 'xterm-core' { * (CSI 3 8 ; 2 ; Pi ; Pr ; Pg ; Pb) */ getFgColor(): number; - + /** * Gets a cell's background color number, this differs depending on what the * color mode of the cell is: @@ -1022,7 +1028,7 @@ declare module 'xterm-core' { * (CSI 4 8 ; 2 ; Pi ; Pr ; Pg ; Pb) */ getBgColor(): number; - + /** Whether the cell has the bold attribute (CSI 1 m). */ isBold(): number; /** Whether the cell has the inverse attribute (CSI 3 m). */ @@ -1037,7 +1043,7 @@ declare module 'xterm-core' { isInverse(): number; /** Whether the cell has the inverse attribute (CSI 8 m). */ isInvisible(): number; - + /** Whether the cell is using the RGB foreground color mode. */ isFgRGB(): boolean; /** Whether the cell is using the RGB background color mode. */ @@ -1050,11 +1056,11 @@ declare module 'xterm-core' { isFgDefault(): boolean; /** Whether the cell is using the default background color mode. */ isBgDefault(): boolean; - + /** Whether the cell has the default attribute (no color or style). */ isAttributeDefault(): boolean; } - + /** * Data type to register a CSI, DCS or ESC callback in the parser * in the form: @@ -1098,7 +1104,7 @@ declare module 'xterm-core' { */ final: string; } - + /** * Allows hooking into the parser for custom handling of escape sequences. */ @@ -1116,7 +1122,7 @@ declare module 'xterm-core' { * @return An IDisposable you can call to remove this handler. */ registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable; - + /** * Adds a handler for DCS escape sequences. * @param id Specifies the function identifier under which the callback @@ -1135,7 +1141,7 @@ declare module 'xterm-core' { * @return An IDisposable you can call to remove this handler. */ registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable; - + /** * Adds a handler for ESC escape sequences. * @param id Specifies the function identifier under which the callback @@ -1148,7 +1154,7 @@ declare module 'xterm-core' { * @return An IDisposable you can call to remove this handler. */ registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable; - + /** * Adds a handler for OSC escape sequences. * @param ident The number (first parameter) of the sequence. @@ -1167,7 +1173,7 @@ declare module 'xterm-core' { */ registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable; } - + /** * (EXPERIMENTAL) Unicode version provider. * Used to register custom Unicode versions with `Terminal.unicode.register`. @@ -1177,13 +1183,13 @@ declare module 'xterm-core' { * String indicating the Unicode version provided. */ readonly version: string; - + /** * Unicode version dependent wcwidth implementation. */ wcwidth(codepoint: number): 0 | 1 | 2; } - + /** * (EXPERIMENTAL) Unicode handling interface. */ @@ -1192,16 +1198,15 @@ declare module 'xterm-core' { * Register a custom Unicode version provider. */ register(provider: IUnicodeVersionProvider): void; - + /** * Registered Unicode versions. */ readonly versions: ReadonlyArray; - + /** * Getter/setter for active Unicode version. */ activeVersion: string; } } - \ No newline at end of file From f769d03e0c32ee1155ecdcf956b7b8b9ca8e3654 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 12:27:43 -0700 Subject: [PATCH 17/42] xterm-core -> xterm-headless --- node-test/README.md | 2 +- node-test/index.js | 2 +- package.json | 1 + src/headless/public/Terminal.ts | 2 +- src/headless/tsconfig.json | 2 +- .../{xterm-core.d.ts => xterm-headless.d.ts} | 2 +- webpack.config.core.js | 41 ------------------- webpack.config.headless.js | 8 ++-- 8 files changed, 10 insertions(+), 50 deletions(-) rename typings/{xterm-core.d.ts => xterm-headless.d.ts} (99%) delete mode 100644 webpack.config.core.js diff --git a/node-test/README.md b/node-test/README.md index 0da50146..cd346848 100644 --- a/node-test/README.md +++ b/node-test/README.md @@ -1,4 +1,4 @@ -Cursory test that 'xterm-core' works: +Cursory test that 'xterm-headless' works: ``` # From root of this repo diff --git a/node-test/index.js b/node-test/index.js index 2fd8da7f..55359c8e 100644 --- a/node-test/index.js +++ b/node-test/index.js @@ -2,7 +2,7 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); const Terminal = require('../lib-headless/xterm.js').Terminal; -console.log('Creating xterm-core terminal...'); +console.log('Creating xterm-headless terminal...'); const terminal = new Terminal(); console.log('Writing to terminal...') terminal.write('foo \x1b[1;31mbar\x1b[0m baz', () => { diff --git a/package.json b/package.json index 47fd0a89..beffc66b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "prepackage": "npm run build", "package": "webpack", + "package-headless": "webpack --config ./webpack.config.headless.js", "compile": "tsc -b ./src/common/public/tsconfig.json", "start": "node demo/start", "start-debug": "node --inspect-brk demo/start", diff --git a/src/headless/public/Terminal.ts b/src/headless/public/Terminal.ts index 44f9753a..f14bdd55 100644 --- a/src/headless/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -7,7 +7,7 @@ import { IEvent } from 'common/EventEmitter'; import { BufferNamespaceApi } from 'common/public/BufferNamespaceApi'; import { ParserApi } from 'common/public/ParserApi'; import { UnicodeApi } from 'common/public/UnicodeApi'; -import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalAddon, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-core'; +import { IBufferNamespace as IBufferNamespaceApi, IMarker, IParser, ITerminalAddon, ITerminalOptions, IUnicodeHandling, Terminal as ITerminalApi } from 'xterm-headless'; import { Terminal as TerminalCore } from 'headless/Terminal'; import { AddonManager } from 'common/public/AddonManager'; diff --git a/src/headless/tsconfig.json b/src/headless/tsconfig.json index 6085a07f..b579af97 100644 --- a/src/headless/tsconfig.json +++ b/src/headless/tsconfig.json @@ -18,7 +18,7 @@ "include": [ "./**/*", "../../typings/xterm.d.ts", // common/Types.d.ts imports from 'xterm' - "../../typings/xterm-core.d.ts" + "../../typings/xterm-headless.d.ts" ], "references": [ { "path": "../common" } diff --git a/typings/xterm-core.d.ts b/typings/xterm-headless.d.ts similarity index 99% rename from typings/xterm-core.d.ts rename to typings/xterm-headless.d.ts index eabb51fc..3dd9d69e 100644 --- a/typings/xterm-core.d.ts +++ b/typings/xterm-headless.d.ts @@ -7,7 +7,7 @@ * to be stable and consumed by external programs. */ -declare module 'xterm-core' { +declare module 'xterm-headless' { /** * A string representing log level. */ diff --git a/webpack.config.core.js b/webpack.config.core.js deleted file mode 100644 index 85c37ff1..00000000 --- a/webpack.config.core.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2019 The xterm.js authors. All rights reserved. - * @license MIT - */ - -const path = require('path'); - -/** - * This webpack config does a production build for xterm-core.js. It works by taking the output from tsc - * (via `yarn watch` or `yarn prebuild`) which are put into `xterm-core/` and webpacks them into a - * production mode commonjs library module in `lib/`. The aliases are used fix up the absolute paths - * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. - */ -module.exports = { - entry: './xterm-core/common/public/Terminal.js', - devtool: 'source-map', - module: { - rules: [ - { - test: /\.js$/, - use: ["source-map-loader"], - enforce: "pre", - exclude: /node_modules/ - } - ] - }, - resolve: { - modules: ['./node_modules'], - extensions: [ '.js' ], - alias: { - common: path.resolve('./xterm-core/common') - } - }, - output: { - filename: 'xterm-core.js', - path: path.resolve('./lib'), - libraryTarget: 'commonjs' - }, - mode: 'production', - target: 'node', -}; diff --git a/webpack.config.headless.js b/webpack.config.headless.js index 7ae66676..805b9a3e 100644 --- a/webpack.config.headless.js +++ b/webpack.config.headless.js @@ -6,10 +6,10 @@ const path = require('path'); /** - * This webpack config does a production build for xterm.js. It works by taking the output from tsc - * (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a - * production mode umd library module in `lib/`. The aliases are used fix up the absolute paths - * output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. + * This webpack config does a production build for xterm.js headless. It works by taking the output + * from tsc (via `yarn watch` or `yarn prebuild`) which are put into `out/` and webpacks them into a + * production mode umd library module in `lib-headless/`. The aliases are used fix up the absolute + * paths output by tsc (because of `baseUrl` and `paths` in `tsconfig.json`. */ module.exports = { entry: './out/headless/public/Terminal.js', From 4a200e59acc6e655e05e78767cbbae5f3a5318fb Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 12:50:22 -0700 Subject: [PATCH 18/42] Create headless package script --- bin/package_headless.js | 40 ++++++++++++++++++++++++++++++++++++++++ headless/.gitignore | 2 ++ headless/README.md | 5 +++++ 3 files changed, 47 insertions(+) create mode 100644 bin/package_headless.js create mode 100644 headless/.gitignore create mode 100644 headless/README.md diff --git a/bin/package_headless.js b/bin/package_headless.js new file mode 100644 index 00000000..27613200 --- /dev/null +++ b/bin/package_headless.js @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021 The xterm.js authors. All rights reserved. + * @license MIT + */ + +const fs = require('fs'); +const { join } = require('path'); + +const repoRoot = join(__dirname, '..'); +const headlessRoot = join(repoRoot, 'headless'); + +// Create headless/package.json +console.log('> Creating headless/package.json'); +const xtermPackageJson = require('../package.json'); +const xtermHeadlessPackageJson = { + ...xtermPackageJson, + name: 'xterm-headless', + description: 'A headless terminal component that runs in Node.js', + main: 'lib/xterm-headless.js', + types: 'typings/xterm-headless.d.ts', +}; +delete xtermHeadlessPackageJson['scripts']; +delete xtermHeadlessPackageJson['devDependencies']; +delete xtermHeadlessPackageJson['style']; +xtermHeadlessPackageJson.version += '-alpha'; +fs.writeFileSync(join(headlessRoot, 'package.json'), JSON.stringify(xtermHeadlessPackageJson, null, 1)); +console.log(fs.readFileSync(join(headlessRoot, 'package.json')).toString()); + +console.log('> Creating headless/typings'); +mkdirF(join(headlessRoot, 'typings')); +fs.copyFileSync( + join(repoRoot, 'typings/xterm-headless.d.ts'), + join(headlessRoot, 'typings/xterm-headless.d.ts') +); + +function mkdirF(p) { + if (!fs.existsSync(p)) { + fs.mkdirSync(p); + } +} diff --git a/headless/.gitignore b/headless/.gitignore new file mode 100644 index 00000000..9b8b2749 --- /dev/null +++ b/headless/.gitignore @@ -0,0 +1,2 @@ +typings/ +package.json diff --git a/headless/README.md b/headless/README.md new file mode 100644 index 00000000..de22b47a --- /dev/null +++ b/headless/README.md @@ -0,0 +1,5 @@ +# [![xterm.js logo](../logo-full.png)](https://xtermjs.org) + +⚠ This package is a work in progress + +`xterm-headless` is a headless terminal that can be run in node.js. This is useful in combination with the frontend [`xterm`](https://www.npmjs.com/package/xterm) for example to keep track of a terminal's state on a remote server where the process is hosted. From 15bd827c2ee6c516a32b05dcdd7652db76d26b69 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 12:57:45 -0700 Subject: [PATCH 19/42] Improve headless packaging --- .gitignore | 1 - bin/package_headless.js | 2 +- headless/.gitignore | 1 + package.json | 1 + webpack.config.headless.js | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4958559e..8aea04b2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ node_modules/ *.swp .lock-wscript lib/ -lib-headless/ out/ out-test/ .nyc_output/ diff --git a/bin/package_headless.js b/bin/package_headless.js index 27613200..104844e2 100644 --- a/bin/package_headless.js +++ b/bin/package_headless.js @@ -16,7 +16,7 @@ const xtermHeadlessPackageJson = { ...xtermPackageJson, name: 'xterm-headless', description: 'A headless terminal component that runs in Node.js', - main: 'lib/xterm-headless.js', + main: 'lib-headless/xterm-headless.js', types: 'typings/xterm-headless.d.ts', }; delete xtermHeadlessPackageJson['scripts']; diff --git a/headless/.gitignore b/headless/.gitignore index 9b8b2749..4aba0be5 100644 --- a/headless/.gitignore +++ b/headless/.gitignore @@ -1,2 +1,3 @@ +lib-headless/ typings/ package.json diff --git a/package.json b/package.json index beffc66b..2d128b08 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "prepackage": "npm run build", "package": "webpack", "package-headless": "webpack --config ./webpack.config.headless.js", + "postpackage-headless": "node ./bin/package_headless.js", "compile": "tsc -b ./src/common/public/tsconfig.json", "start": "node demo/start", "start-debug": "node --inspect-brk demo/start", diff --git a/webpack.config.headless.js b/webpack.config.headless.js index 805b9a3e..2fe75915 100644 --- a/webpack.config.headless.js +++ b/webpack.config.headless.js @@ -34,7 +34,7 @@ module.exports = { }, output: { filename: 'xterm.js', - path: path.resolve('./lib-headless'), + path: path.resolve('./headless/lib-headless'), library: { type: 'commonjs' } From 6aa0782ce34fa02171d09b9b1df4d33d012e3018 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:14:05 -0700 Subject: [PATCH 20/42] Publish dry run in package_headless --- bin/package_headless.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/package_headless.js b/bin/package_headless.js index 104844e2..37d846df 100644 --- a/bin/package_headless.js +++ b/bin/package_headless.js @@ -3,6 +3,7 @@ * @license MIT */ +const { spawn, exec } = require('child_process'); const fs = require('fs'); const { join } = require('path'); @@ -38,3 +39,15 @@ function mkdirF(p) { fs.mkdirSync(p); } } + +console.log('> Publish dry run'); +exec('npm publish --dry-run', { cwd: headlessRoot }, (error, stdout, stderr) => { + if (error) { + console.log(`error: ${error.message}`); + return; + } + if (stderr) { + console.error(`stderr:\n${stderr}`); + } + console.log(`stdout:\n${stdout}`); +}); From 69ce01c794e965847bfaea4747318a62e0856e68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Aug 2021 22:58:26 +0000 Subject: [PATCH 21/42] Bump path-parse from 1.0.6 to 1.0.7 Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ee0f0558..571f8a90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3356,9 +3356,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-to-regexp@0.1.7: version "0.1.7" From 83ddf0fc4bf299507002f00bc88743c2e538ebd7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 04:46:27 -0700 Subject: [PATCH 22/42] Force publish of headless even in PR --- bin/publish.js | 8 ++++++-- node-test/index.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/publish.js b/bin/publish.js index 64336fdc..fc4ad99c 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -6,6 +6,7 @@ const cp = require('child_process'); const fs = require('fs'); const os = require('os'); +const { basename } = require('path'); const path = require('path'); // Setup auth @@ -22,6 +23,7 @@ const changedFiles = getChangedFilesInCommit('HEAD'); let isStableRelease = false; if (changedFiles.some(e => e.search(/^addons\//) === -1)) { isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..')); + checkAndPublishPackage(path.resolve(__dirname, '../headless')); } // Publish addons if any files were changed inside of the addon @@ -70,11 +72,13 @@ function checkAndPublishPackage(packageDir) { // Publish const args = ['publish']; - if (!isStableRelease) { + if (basename(packageDir) === 'headless') { + args.push('--tag', 'beta'); + } else if (!isStableRelease) { args.push('--tag', 'beta'); } console.log(`Spawn: npm ${args.join(' ')}`); - if (!isDryRun) { + if (!isDryRun || basename(packageDir) === 'headless') { const result = cp.spawnSync('npm', args, { cwd: packageDir, stdio: 'inherit' diff --git a/node-test/index.js b/node-test/index.js index 55359c8e..021f2ecd 100644 --- a/node-test/index.js +++ b/node-test/index.js @@ -1,6 +1,6 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); -const Terminal = require('../lib-headless/xterm.js').Terminal; +const Terminal = require('../headless/lib-headless/xterm.js').Terminal; console.log('Creating xterm-headless terminal...'); const terminal = new Terminal(); From f685d8eb21263732cbb4e3c6941ae2851b6c68be Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 04:52:37 -0700 Subject: [PATCH 23/42] Force publish --- azure-pipelines.yml | 2 +- bin/publish.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f4220176..0cd932df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -145,7 +145,7 @@ jobs: - Linux_IntegrationTests - macOS_IntegrationTests - Windows_IntegrationTests - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['FORCE_RELEASE'], 'true'))) + # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['FORCE_RELEASE'], 'true'))) pool: vmImage: 'ubuntu-16.04' steps: diff --git a/bin/publish.js b/bin/publish.js index fc4ad99c..357e2892 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -22,20 +22,20 @@ const changedFiles = getChangedFilesInCommit('HEAD'); // Publish xterm if any files were changed outside of the addons directory let isStableRelease = false; if (changedFiles.some(e => e.search(/^addons\//) === -1)) { - isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..')); + // isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..')); checkAndPublishPackage(path.resolve(__dirname, '../headless')); } // Publish addons if any files were changed inside of the addon const addonPackageDirs = [ - path.resolve(__dirname, '../addons/xterm-addon-attach'), - path.resolve(__dirname, '../addons/xterm-addon-fit'), - path.resolve(__dirname, '../addons/xterm-addon-ligatures'), - path.resolve(__dirname, '../addons/xterm-addon-search'), - path.resolve(__dirname, '../addons/xterm-addon-serialize'), - path.resolve(__dirname, '../addons/xterm-addon-unicode11'), - path.resolve(__dirname, '../addons/xterm-addon-web-links'), - path.resolve(__dirname, '../addons/xterm-addon-webgl') + // path.resolve(__dirname, '../addons/xterm-addon-attach'), + // path.resolve(__dirname, '../addons/xterm-addon-fit'), + // path.resolve(__dirname, '../addons/xterm-addon-ligatures'), + // path.resolve(__dirname, '../addons/xterm-addon-search'), + // path.resolve(__dirname, '../addons/xterm-addon-serialize'), + // path.resolve(__dirname, '../addons/xterm-addon-unicode11'), + // path.resolve(__dirname, '../addons/xterm-addon-web-links'), + // path.resolve(__dirname, '../addons/xterm-addon-webgl') ]; console.log(`Checking if addons need to be published`); for (const p of addonPackageDirs) { @@ -48,7 +48,7 @@ for (const p of addonPackageDirs) { // Publish website if it's a stable release if (isStableRelease) { - updateWebsite(); + // updateWebsite(); } function checkAndPublishPackage(packageDir) { @@ -72,11 +72,11 @@ function checkAndPublishPackage(packageDir) { // Publish const args = ['publish']; - if (basename(packageDir) === 'headless') { - args.push('--tag', 'beta'); - } else if (!isStableRelease) { - args.push('--tag', 'beta'); - } + args.push('--tag', 'beta'); + // if (basename(packageDir) === 'headless') { + // } else if (!isStableRelease) { + // args.push('--tag', 'beta'); + // } console.log(`Spawn: npm ${args.join(' ')}`); if (!isDryRun || basename(packageDir) === 'headless') { const result = cp.spawnSync('npm', args, { From 97fa4a59b700f25f244a20dc8d2beaad1c790fca Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 05:54:37 -0700 Subject: [PATCH 24/42] Package headless in release step --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0cd932df..95a97e59 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -164,5 +164,7 @@ jobs: displayName: Cache node modules - script: yarn --frozen-lockfile displayName: 'Install dependencies and build' + - script: node ./bin/package_headless.js + displayName: 'Package xterm-headless' - script: NPM_AUTH_TOKEN="$(NPM_AUTH_TOKEN)" node ./bin/publish.js displayName: 'Package and publish to npm' From b6e54307025be84c5eaf7230783cded7a028374f Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:04:48 -0700 Subject: [PATCH 25/42] Revert "Force publish" This reverts commit f685d8eb21263732cbb4e3c6941ae2851b6c68be. --- azure-pipelines.yml | 2 +- bin/publish.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 95a97e59..c87496b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -145,7 +145,7 @@ jobs: - Linux_IntegrationTests - macOS_IntegrationTests - Windows_IntegrationTests - # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['FORCE_RELEASE'], 'true'))) + condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['FORCE_RELEASE'], 'true'))) pool: vmImage: 'ubuntu-16.04' steps: diff --git a/bin/publish.js b/bin/publish.js index 357e2892..fc4ad99c 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -22,20 +22,20 @@ const changedFiles = getChangedFilesInCommit('HEAD'); // Publish xterm if any files were changed outside of the addons directory let isStableRelease = false; if (changedFiles.some(e => e.search(/^addons\//) === -1)) { - // isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..')); + isStableRelease = checkAndPublishPackage(path.resolve(__dirname, '..')); checkAndPublishPackage(path.resolve(__dirname, '../headless')); } // Publish addons if any files were changed inside of the addon const addonPackageDirs = [ - // path.resolve(__dirname, '../addons/xterm-addon-attach'), - // path.resolve(__dirname, '../addons/xterm-addon-fit'), - // path.resolve(__dirname, '../addons/xterm-addon-ligatures'), - // path.resolve(__dirname, '../addons/xterm-addon-search'), - // path.resolve(__dirname, '../addons/xterm-addon-serialize'), - // path.resolve(__dirname, '../addons/xterm-addon-unicode11'), - // path.resolve(__dirname, '../addons/xterm-addon-web-links'), - // path.resolve(__dirname, '../addons/xterm-addon-webgl') + path.resolve(__dirname, '../addons/xterm-addon-attach'), + path.resolve(__dirname, '../addons/xterm-addon-fit'), + path.resolve(__dirname, '../addons/xterm-addon-ligatures'), + path.resolve(__dirname, '../addons/xterm-addon-search'), + path.resolve(__dirname, '../addons/xterm-addon-serialize'), + path.resolve(__dirname, '../addons/xterm-addon-unicode11'), + path.resolve(__dirname, '../addons/xterm-addon-web-links'), + path.resolve(__dirname, '../addons/xterm-addon-webgl') ]; console.log(`Checking if addons need to be published`); for (const p of addonPackageDirs) { @@ -48,7 +48,7 @@ for (const p of addonPackageDirs) { // Publish website if it's a stable release if (isStableRelease) { - // updateWebsite(); + updateWebsite(); } function checkAndPublishPackage(packageDir) { @@ -72,11 +72,11 @@ function checkAndPublishPackage(packageDir) { // Publish const args = ['publish']; - args.push('--tag', 'beta'); - // if (basename(packageDir) === 'headless') { - // } else if (!isStableRelease) { - // args.push('--tag', 'beta'); - // } + if (basename(packageDir) === 'headless') { + args.push('--tag', 'beta'); + } else if (!isStableRelease) { + args.push('--tag', 'beta'); + } console.log(`Spawn: npm ${args.join(' ')}`); if (!isDryRun || basename(packageDir) === 'headless') { const result = cp.spawnSync('npm', args, { From 5affa70097e154dc56118302942428e891331c2d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:06:06 -0700 Subject: [PATCH 26/42] Undo headless force publish changes --- bin/publish.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/publish.js b/bin/publish.js index fc4ad99c..aaf9cac0 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -72,13 +72,11 @@ function checkAndPublishPackage(packageDir) { // Publish const args = ['publish']; - if (basename(packageDir) === 'headless') { - args.push('--tag', 'beta'); - } else if (!isStableRelease) { + if (!isStableRelease) { args.push('--tag', 'beta'); } console.log(`Spawn: npm ${args.join(' ')}`); - if (!isDryRun || basename(packageDir) === 'headless') { + if (!isDryRun) { const result = cp.spawnSync('npm', args, { cwd: packageDir, stdio: 'inherit' From 3e9b1bafbe5c4771165f3cb23bf38e99487a76b7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:10:12 -0700 Subject: [PATCH 27/42] Remove force publish changes --- bin/publish.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/publish.js b/bin/publish.js index aaf9cac0..3c729f6c 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -6,7 +6,6 @@ const cp = require('child_process'); const fs = require('fs'); const os = require('os'); -const { basename } = require('path'); const path = require('path'); // Setup auth From 370d0c562ad059961bfa62147c455e8592a80985 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:19:53 -0700 Subject: [PATCH 28/42] Copy logo-full.png --- bin/package_headless.js | 15 ++++++++++----- headless/.gitignore | 1 + headless/README.md | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bin/package_headless.js b/bin/package_headless.js index 37d846df..0d4170df 100644 --- a/bin/package_headless.js +++ b/bin/package_headless.js @@ -3,15 +3,14 @@ * @license MIT */ -const { spawn, exec } = require('child_process'); +const { exec } = require('child_process'); const fs = require('fs'); const { join } = require('path'); const repoRoot = join(__dirname, '..'); const headlessRoot = join(repoRoot, 'headless'); -// Create headless/package.json -console.log('> Creating headless/package.json'); +console.log('> headless/package.json'); const xtermPackageJson = require('../package.json'); const xtermHeadlessPackageJson = { ...xtermPackageJson, @@ -23,17 +22,23 @@ const xtermHeadlessPackageJson = { delete xtermHeadlessPackageJson['scripts']; delete xtermHeadlessPackageJson['devDependencies']; delete xtermHeadlessPackageJson['style']; -xtermHeadlessPackageJson.version += '-alpha'; +xtermHeadlessPackageJson.version += '-alpha1'; fs.writeFileSync(join(headlessRoot, 'package.json'), JSON.stringify(xtermHeadlessPackageJson, null, 1)); console.log(fs.readFileSync(join(headlessRoot, 'package.json')).toString()); -console.log('> Creating headless/typings'); +console.log('> headless/typings/'); mkdirF(join(headlessRoot, 'typings')); fs.copyFileSync( join(repoRoot, 'typings/xterm-headless.d.ts'), join(headlessRoot, 'typings/xterm-headless.d.ts') ); +console.log('> headless/logo-full.png'); +fs.copyFileSync( + join(repoRoot, 'logo-full.png'), + join(headlessRoot, 'logo-full.png') +); + function mkdirF(p) { if (!fs.existsSync(p)) { fs.mkdirSync(p); diff --git a/headless/.gitignore b/headless/.gitignore index 4aba0be5..aa6706ab 100644 --- a/headless/.gitignore +++ b/headless/.gitignore @@ -1,3 +1,4 @@ lib-headless/ typings/ +logo-full.png package.json diff --git a/headless/README.md b/headless/README.md index de22b47a..358c97ef 100644 --- a/headless/README.md +++ b/headless/README.md @@ -1,4 +1,4 @@ -# [![xterm.js logo](../logo-full.png)](https://xtermjs.org) +# [![xterm.js logo](logo-full.png)](https://xtermjs.org) ⚠ This package is a work in progress From be164293170735ab635438d87316083b2f1f0fa9 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:23:42 -0700 Subject: [PATCH 29/42] Remove unused compile script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 2d128b08..71a0f308 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "package": "webpack", "package-headless": "webpack --config ./webpack.config.headless.js", "postpackage-headless": "node ./bin/package_headless.js", - "compile": "tsc -b ./src/common/public/tsconfig.json", "start": "node demo/start", "start-debug": "node --inspect-brk demo/start", "lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/", From 454c2726a5e0532f93dcf2e5e0ebc0e7cad6b129 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:30:15 -0700 Subject: [PATCH 30/42] Add npmignore --- headless/.npmignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 headless/.npmignore diff --git a/headless/.npmignore b/headless/.npmignore new file mode 100644 index 00000000..41f2a3a9 --- /dev/null +++ b/headless/.npmignore @@ -0,0 +1,2 @@ +# Include +!typings/*.d.ts From dda4904d9daa4bb403c3b3d1ebb178c23acd02fa Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:42:00 -0700 Subject: [PATCH 31/42] Fix xterm-headless lib file --- webpack.config.headless.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.headless.js b/webpack.config.headless.js index 2fe75915..d5bb97b7 100644 --- a/webpack.config.headless.js +++ b/webpack.config.headless.js @@ -33,7 +33,7 @@ module.exports = { } }, output: { - filename: 'xterm.js', + filename: 'xterm-headless.js', path: path.resolve('./headless/lib-headless'), library: { type: 'commonjs' From 34d6449d076d740a6e2e7fcebe311feb2624042a Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 11 Aug 2021 23:40:25 -0700 Subject: [PATCH 32/42] add TermPair and gdbgui to real world uses list --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d926afe..479c8113 100644 --- a/README.md +++ b/README.md @@ -162,21 +162,23 @@ Xterm.js is used in several world-class applications to provide great terminal e - [**CoCalc**](https://cocalc.com/): Lots of free software pre-installed, to chat, collaborate, develop, program, publish, research, share, teach, in C++, HTML, Julia, Jupyter, LaTeX, Markdown, Python, R, SageMath, Scala, ... - [**Dank Domain**](https://www.DDgame.us/): Open source multiuser medieval game supporting old & new terminal emulation. - [**DockerStacks**](https://docker-stacks.com/): Local LAMP/LEMP development studio -- [**Codecademy**](https://codecademy.com/): Uses xterm.js in its courses on Bash. +- [**Codecademy**](https://codecademy.com/): Uses xterm.js in its courses on Bash. - [**Laravel Ssh Web Client**](https://github.com/roke22/Laravel-ssh-client): Laravel server inventory with ssh web client to connect at server using xterm.js - [**Repl.it**](https://repl.it): Collaborative browser based IDE with support for 50+ different languages. - [**TeleType**](https://github.com/akshaykmr/TeleType): cli tool that allows you to share your terminal online conveniently. Show off mad cli-fu, help a colleague, teach, or troubleshoot. - [**Intervue**](https://www.intervue.io): Pair programming for interviews. Multiple programming languages are supported, with results displayed by xterm.js. -- [**TRASA**](https://trasa.io): Zero trust access to Web, SSH, RDP, and Database services. +- [**TRASA**](https://trasa.io): Zero trust access to Web, SSH, RDP, and Database services. - [**Commas**](https://github.com/CyanSalt/commas): Commas is a hackable terminal and command runner. -- [**Devtron**](https://github.com/devtron-labs/devtron): Software Delivery Workflow For Kubernetes. +- [**Devtron**](https://github.com/devtron-labs/devtron): Software Delivery Workflow For Kubernetes. - [**NxShell**](https://github.com/nxshell/nxshell): An easy to use new terminal for SSH. - [**gifcast**](https://dstein64.github.io/gifcast/): Converts an asciinema cast to an animated GIF. - [**WizardWebssh**](https://gitlab.com/mikeramsey/wizardwebssh): A terminal with Pyqt5 Widget for embedding, which can be used as an ssh client to connect to your ssh servers. It is written in Python, based on tornado, paramiko, and xterm.js. -- [**Wizard Assistant**](https://wizardassistant.com/): Wizard Assistant comes with advanced automation tools, preloaded common and special time-saving commands, and a built-in SSH terminal. Now you can remotely administer, troubleshoot, and analyze any system with ease. +- [**Wizard Assistant**](https://wizardassistant.com/): Wizard Assistant comes with advanced automation tools, preloaded common and special time-saving commands, and a built-in SSH terminal. Now you can remotely administer, troubleshoot, and analyze any system with ease. - [**ucli**](https://github.com/tsadarsh/ucli): Command Line for everyone :family_man_woman_girl_boy: at [www.ucli.tech](https://www.ucli.tech). - [**Tess**](https://github.com/SquitchYT/Tess/): Simple Terminal Fully Customizable for Everyone. - [**HashiCorp Nomad**](https://www.nomadproject.io/): A container orchestrator with the ability to connect to remote tasks via a web interface using websockets and xterm.js. +- [**TermPair**](https://github.com/cs01/termpair): View and control terminals from your browser with end-to-end encryption +- [**gdbgui**](https://github.com/cs01/gdbgui): Browser-based frontend to gdb (gnu debugger) - [And much more...](https://github.com/xtermjs/xterm.js/network/dependents) Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it on our list. Note: Please add any new contributions to the end of the list only. From 7e7dcd991752be5c5e765e6878c607bc162844fe Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 04:51:21 -0700 Subject: [PATCH 33/42] Move node-test into headless folder --- bin/package_headless.js | 2 +- headless/.gitignore | 2 +- headless/.npmignore | 3 +++ headless/package.json | 9 +++++++++ headless/test/README.md | 9 +++++++++ {node-test => headless/test}/index.js | 0 {node-test => headless/test}/package.json | 0 node-test/README.md | 10 ---------- 8 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 headless/package.json create mode 100644 headless/test/README.md rename {node-test => headless/test}/index.js (100%) rename {node-test => headless/test}/package.json (100%) delete mode 100644 node-test/README.md diff --git a/bin/package_headless.js b/bin/package_headless.js index 0d4170df..0dcec90b 100644 --- a/bin/package_headless.js +++ b/bin/package_headless.js @@ -22,7 +22,7 @@ const xtermHeadlessPackageJson = { delete xtermHeadlessPackageJson['scripts']; delete xtermHeadlessPackageJson['devDependencies']; delete xtermHeadlessPackageJson['style']; -xtermHeadlessPackageJson.version += '-alpha1'; +xtermHeadlessPackageJson.version += '-alpha3'; fs.writeFileSync(join(headlessRoot, 'package.json'), JSON.stringify(xtermHeadlessPackageJson, null, 1)); console.log(fs.readFileSync(join(headlessRoot, 'package.json')).toString()); diff --git a/headless/.gitignore b/headless/.gitignore index aa6706ab..f1cf6c8d 100644 --- a/headless/.gitignore +++ b/headless/.gitignore @@ -1,4 +1,4 @@ lib-headless/ typings/ logo-full.png -package.json +./package.json diff --git a/headless/.npmignore b/headless/.npmignore index 41f2a3a9..c6b33260 100644 --- a/headless/.npmignore +++ b/headless/.npmignore @@ -1,2 +1,5 @@ # Include !typings/*.d.ts + +# Exclude +test/ diff --git a/headless/package.json b/headless/package.json new file mode 100644 index 00000000..d53761e7 --- /dev/null +++ b/headless/package.json @@ -0,0 +1,9 @@ +{ + "name": "xterm-headless", + "description": "A headless terminal component that runs in Node.js", + "version": "4.13.0-alpha3", + "main": "lib-headless/xterm-headless.js", + "types": "typings/xterm-headless.d.ts", + "repository": "https://github.com/xtermjs/xterm.js", + "license": "MIT" +} \ No newline at end of file diff --git a/headless/test/README.md b/headless/test/README.md new file mode 100644 index 00000000..e48da411 --- /dev/null +++ b/headless/test/README.md @@ -0,0 +1,9 @@ +This is a basic manual test for 'xterm-headless': + +```sh +# From repo root +yarn build +yarn package-headless +cd headless/test +node index.js +``` diff --git a/node-test/index.js b/headless/test/index.js similarity index 100% rename from node-test/index.js rename to headless/test/index.js diff --git a/node-test/package.json b/headless/test/package.json similarity index 100% rename from node-test/package.json rename to headless/test/package.json diff --git a/node-test/README.md b/node-test/README.md deleted file mode 100644 index cd346848..00000000 --- a/node-test/README.md +++ /dev/null @@ -1,10 +0,0 @@ -Cursory test that 'xterm-headless' works: - -``` -# From root of this repo -npm run compile # Outputs to out/headless -npx webpack --config webpack.config.headless.js # Outputs to lib -cd node-test -npm link ../lib/ -node index.js -``` From ec80fc9421e910bc97fc99fea4ba51ea00f7bdcf Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 04:51:49 -0700 Subject: [PATCH 34/42] Remove alpha from package.json version --- bin/package_headless.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/package_headless.js b/bin/package_headless.js index 0dcec90b..d002a95e 100644 --- a/bin/package_headless.js +++ b/bin/package_headless.js @@ -22,7 +22,6 @@ const xtermHeadlessPackageJson = { delete xtermHeadlessPackageJson['scripts']; delete xtermHeadlessPackageJson['devDependencies']; delete xtermHeadlessPackageJson['style']; -xtermHeadlessPackageJson.version += '-alpha3'; fs.writeFileSync(join(headlessRoot, 'package.json'), JSON.stringify(xtermHeadlessPackageJson, null, 1)); console.log(fs.readFileSync(join(headlessRoot, 'package.json')).toString()); From e96b472edea9305ea306b6bddb6ef584fe481fa9 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 05:35:20 -0700 Subject: [PATCH 35/42] Start on headless unit tests --- src/headless/Terminal.test.ts | 27 -- src/headless/public/Terminal.test.ts | 547 +++++++++++++++++++++++++++ test/api/Terminal.api.ts | 18 +- 3 files changed, 553 insertions(+), 39 deletions(-) delete mode 100644 src/headless/Terminal.test.ts create mode 100644 src/headless/public/Terminal.test.ts diff --git a/src/headless/Terminal.test.ts b/src/headless/Terminal.test.ts deleted file mode 100644 index 07f90436..00000000 --- a/src/headless/Terminal.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2016 The xterm.js authors. All rights reserved. - * @license MIT - */ - -import { deepStrictEqual, throws } from 'assert'; -import { Terminal } from 'headless/public/Terminal'; - -const INIT_COLS = 80; -const INIT_ROWS = 24; - -describe('Headless Terminal', () => { - let term: Terminal; - const termOptions = { - cols: INIT_COLS, - rows: INIT_ROWS - }; - - beforeEach(() => { - term = new Terminal(termOptions); - }); - - it('should throw when trying to change cols or rows', () => { - throws(() => term.setOption('cols', 1000)); - throws(() => term.setOption('rows', 1000)); - }); -}); diff --git a/src/headless/public/Terminal.test.ts b/src/headless/public/Terminal.test.ts new file mode 100644 index 00000000..9f45b78e --- /dev/null +++ b/src/headless/public/Terminal.test.ts @@ -0,0 +1,547 @@ +/** + * Copyright (c) 2019 The xterm.js authors. All rights reserved. + * @license MIT + */ + +import { strictEqual, throws } from 'assert'; +import { Terminal } from 'headless/public/Terminal'; + +let term: Terminal; + +describe.only('Headless API Tests', function(): void { + beforeEach(() => { + // Create default terminal to be used by most tests + term = new Terminal(); + }); + + it('Default options', async () => { + strictEqual(term.cols, 80); + strictEqual(term.rows, 24); + }); + + it('Proposed API check', async () => { + term = new Terminal({ allowProposedApi: false }); + throws(() => term.buffer, (error) => error.message === 'You must set the allowProposedApi option to true to use proposed API'); + }); + + it('write', async () => { + await writeSync('foo'); + await writeSync('bar'); + await writeSync('文'); + lineEquals(0, 'foobar文'); + }); + + it('write with callback', async () => { + let result: string | undefined; + await new Promise(r => { + term.write('foo', () => { result = 'a'; }); + term.write('bar', () => { result += 'b'; }); + term.write('文', () => { + result += 'c'; + r(); + }); + }); + lineEquals(0, 'foobar文'); + strictEqual(result, 'abc'); + }); + + it('write - bytes (UTF8)', async () => { + await writeSync(new Uint8Array([102, 111, 111])); // foo + await writeSync(new Uint8Array([98, 97, 114])); // bar + await writeSync(new Uint8Array([230, 150, 135])); // 文 + lineEquals(0, 'foobar文'); + }); + + it('write - bytes (UTF8) with callback', async () => { + let result: string | undefined; + await new Promise(r => { + term.write(new Uint8Array([102, 111, 111]), () => { result = 'A'; }); // foo + term.write(new Uint8Array([98, 97, 114]), () => { result += 'B'; }); // bar + term.write(new Uint8Array([230, 150, 135]), () => { // 文 + result += 'C'; + r(); + }); + }); + lineEquals(0, 'foobar文'); + strictEqual(result, 'ABC'); + }); + + it('writeln', async () => { + await writelnSync('foo'); + await writelnSync('bar'); + await writelnSync('文'); + lineEquals(0, 'foo'); + lineEquals(1, 'bar'); + lineEquals(2, '文'); + }); + + it('writeln with callback', async () => { + let result: string | undefined; + await new Promise(r => { + term.writeln('foo', () => { result = '1'; }); + term.writeln('bar', () => { result += '2'; }); + term.writeln('文', () => { + result += '3'; + r(); + }); + }); + lineEquals(0, 'foo'); + lineEquals(1, 'bar'); + lineEquals(2, '文'); + strictEqual(result, '123'); + }); + + it('writeln - bytes (UTF8)', async () => { + await writelnSync(new Uint8Array([102, 111, 111])); + await writelnSync(new Uint8Array([98, 97, 114])); + await writelnSync(new Uint8Array([230, 150, 135])); + lineEquals(0, 'foo'); + lineEquals(1, 'bar'); + lineEquals(2, '文'); + }); + + it('clear', async () => { + term = new Terminal({ rows: 5 }); + for (let i = 0; i < 10; i++) { + await writeSync('\n\rtest' + i); + } + term.clear(); + strictEqual(term.buffer.active.length, 5); + lineEquals(0, 'test9'); + for (let i = 1; i < 5; i++) { + lineEquals(i, ''); + } + }); + + // it('getOption, setOption', async () => { + // await openTerminal(page); + // assert.equal(await page.evaluate(`window.term.getOption('rendererType')`), 'canvas'); + // await page.evaluate(`window.term.setOption('rendererType', 'dom')`); + // assert.equal(await page.evaluate(`window.term.getOption('rendererType')`), 'dom'); + // }); + + // describe('renderer', () => { + // it('foreground', async () => { + // await openTerminal(page, { rendererType: 'dom' }); + // await writeSync(page, '\\x1b[30m0\\x1b[31m1\\x1b[32m2\\x1b[33m3\\x1b[34m4\\x1b[35m5\\x1b[36m6\\x1b[37m7'); + // await pollFor(page, `document.querySelectorAll('.xterm-rows > :nth-child(1) > *').length`, 9); + // assert.deepEqual(await page.evaluate(` + // [ + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(1)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(2)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(3)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(4)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(5)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(6)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(7)').className + // ] + // `), [ + // 'xterm-fg-0', + // 'xterm-fg-1', + // 'xterm-fg-2', + // 'xterm-fg-3', + // 'xterm-fg-4', + // 'xterm-fg-5', + // 'xterm-fg-6' + // ]); + // }); + + // it('background', async () => { + // await openTerminal(page, { rendererType: 'dom' }); + // await writeSync(page, '\\x1b[40m0\\x1b[41m1\\x1b[42m2\\x1b[43m3\\x1b[44m4\\x1b[45m5\\x1b[46m6\\x1b[47m7'); + // await pollFor(page, `document.querySelectorAll('.xterm-rows > :nth-child(1) > *').length`, 9); + // assert.deepEqual(await page.evaluate(` + // [ + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(1)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(2)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(3)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(4)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(5)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(6)').className, + // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(7)').className + // ] + // `), [ + // 'xterm-bg-0', + // 'xterm-bg-1', + // 'xterm-bg-2', + // 'xterm-bg-3', + // 'xterm-bg-4', + // 'xterm-bg-5', + // 'xterm-bg-6' + // ]); + // }); + // }); + + // it('selection', async () => { + // await openTerminal(page, { rows: 5, cols: 5 }); + // await writeSync(page, `\\n\\nfoo\\n\\n\\rbar\\n\\n\\rbaz`); + // assert.equal(await page.evaluate(`window.term.hasSelection()`), false); + // assert.equal(await page.evaluate(`window.term.getSelection()`), ''); + // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), undefined); + // await page.evaluate(`window.term.selectAll()`); + // assert.equal(await page.evaluate(`window.term.hasSelection()`), true); + // if (process.platform === 'win32') { + // assert.equal(await page.evaluate(`window.term.getSelection()`), '\r\n\r\nfoo\r\n\r\nbar\r\n\r\nbaz'); + // } else { + // assert.equal(await page.evaluate(`window.term.getSelection()`), '\n\nfoo\n\nbar\n\nbaz'); + // } + // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), { startColumn: 0, startRow: 0, endColumn: 5, endRow: 6 }); + // await page.evaluate(`window.term.clearSelection()`); + // assert.equal(await page.evaluate(`window.term.hasSelection()`), false); + // assert.equal(await page.evaluate(`window.term.getSelection()`), ''); + // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), undefined); + // await page.evaluate(`window.term.select(1, 2, 2)`); + // assert.equal(await page.evaluate(`window.term.hasSelection()`), true); + // assert.equal(await page.evaluate(`window.term.getSelection()`), 'oo'); + // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), { startColumn: 1, startRow: 2, endColumn: 3, endRow: 2 }); + // }); + + // it('focus, blur', async () => { + // await openTerminal(page); + // assert.equal(await page.evaluate(`document.activeElement.className`), ''); + // await page.evaluate(`window.term.focus()`); + // assert.equal(await page.evaluate(`document.activeElement.className`), 'xterm-helper-textarea'); + // await page.evaluate(`window.term.blur()`); + // assert.equal(await page.evaluate(`document.activeElement.className`), ''); + // }); + + // describe('loadAddon', () => { + // it('constructor', async () => { + // await openTerminal(page, { cols: 5 }); + // await page.evaluate(` + // window.cols = 0; + // window.term.loadAddon({ + // activate: (t) => window.cols = t.cols, + // dispose: () => {} + // }); + // `); + // assert.equal(await page.evaluate(`window.cols`), 5); + // }); + + // it('dispose (addon)', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.disposeCalled = false + // window.addon = { + // activate: () => {}, + // dispose: () => window.disposeCalled = true + // }; + // window.term.loadAddon(window.addon); + // `); + // assert.equal(await page.evaluate(`window.disposeCalled`), false); + // await page.evaluate(`window.addon.dispose()`); + // assert.equal(await page.evaluate(`window.disposeCalled`), true); + // }); + + // it('dispose (terminal)', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.disposeCalled = false + // window.term.loadAddon({ + // activate: () => {}, + // dispose: () => window.disposeCalled = true + // }); + // `); + // assert.equal(await page.evaluate(`window.disposeCalled`), false); + // await page.evaluate(`window.term.dispose()`); + // assert.equal(await page.evaluate(`window.disposeCalled`), true); + // }); + // }); + + // describe('Events', () => { + // it('onCursorMove', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.callCount = 0; + // window.term.onCursorMove(e => window.callCount++); + // window.term.write('foo'); + // `); + // await pollFor(page, `window.callCount`, 1); + // await page.evaluate(`window.term.write('bar')`); + // await pollFor(page, `window.callCount`, 2); + // }); + + // it('onData', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.calls = []; + // window.term.onData(e => calls.push(e)); + // `); + // await page.type('.xterm-helper-textarea', 'foo'); + // assert.deepEqual(await page.evaluate(`window.calls`), ['f', 'o', 'o']); + // }); + + // it('onKey', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.calls = []; + // window.term.onKey(e => calls.push(e.key)); + // `); + // await page.type('.xterm-helper-textarea', 'foo'); + // assert.deepEqual(await page.evaluate(`window.calls`), ['f', 'o', 'o']); + // }); + + // it('onLineFeed', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.callCount = 0; + // window.term.onLineFeed(() => callCount++); + // window.term.writeln('foo'); + // `); + // await pollFor(page, `window.callCount`, 1); + // await page.evaluate(`window.term.writeln('bar')`); + // await pollFor(page, `window.callCount`, 2); + // }); + + // it('onScroll', async () => { + // await openTerminal(page, { rows: 5 }); + // await page.evaluate(` + // window.calls = []; + // window.term.onScroll(e => window.calls.push(e)); + // for (let i = 0; i < 4; i++) { + // window.term.writeln('foo'); + // } + // `); + // await pollFor(page, `window.calls`, []); + // await page.evaluate(`window.term.writeln('bar')`); + // await pollFor(page, `window.calls`, [1]); + // await page.evaluate(`window.term.writeln('baz')`); + // await pollFor(page, `window.calls`, [1, 2]); + // }); + + // it('onSelectionChange', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.callCount = 0; + // window.term.onSelectionChange(() => window.callCount++); + // `); + // await pollFor(page, `window.callCount`, 0); + // await page.evaluate(`window.term.selectAll()`); + // await pollFor(page, `window.callCount`, 1); + // await page.evaluate(`window.term.clearSelection()`); + // await pollFor(page, `window.callCount`, 2); + // }); + + // it('onRender', async function(): Promise { + // this.retries(3); + // await openTerminal(page); + // await timeout(20); // Ensure all init events are fired + // await page.evaluate(` + // window.calls = []; + // window.term.onRender(e => window.calls.push([e.start, e.end])); + // `); + // await pollFor(page, `window.calls`, []); + // await page.evaluate(`window.term.write('foo')`); + // await pollFor(page, `window.calls`, [[0, 0]]); + // await page.evaluate(`window.term.write('bar\\n\\nbaz')`); + // await pollFor(page, `window.calls`, [[0, 0], [0, 2]]); + // }); + + // it('onResize', async () => { + // await openTerminal(page); + // await timeout(20); // Ensure all init events are fired + // await page.evaluate(` + // window.calls = []; + // window.term.onResize(e => window.calls.push([e.cols, e.rows])); + // `); + // await pollFor(page, `window.calls`, []); + // await page.evaluate(`window.term.resize(10, 5)`); + // await pollFor(page, `window.calls`, [[10, 5]]); + // await page.evaluate(`window.term.resize(20, 15)`); + // await pollFor(page, `window.calls`, [[10, 5], [20, 15]]); + // }); + + // it('onTitleChange', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.calls = []; + // window.term.onTitleChange(e => window.calls.push(e)); + // `); + // await pollFor(page, `window.calls`, []); + // await page.evaluate(`window.term.write('\\x1b]2;foo\\x9c')`); + // await pollFor(page, `window.calls`, ['foo']); + // }); + // it('onBell', async () => { + // await openTerminal(page); + // await page.evaluate(` + // window.calls = []; + // window.term.onBell(() => window.calls.push(true)); + // `); + // await pollFor(page, `window.calls`, []); + // await page.evaluate(`window.term.write('\\x07')`); + // await pollFor(page, `window.calls`, [true]); + // }); + // }); + + // describe('buffer', () => { + // it('cursorX, cursorY', async () => { + // await openTerminal(page, { rows: 5, cols: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 0); + // await writeSync(page, 'foo'); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 3); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 0); + // await writeSync(page, '\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 3); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); + // await writeSync(page, '\\r'); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); + // await writeSync(page, 'abcde'); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 5); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); + // await writeSync(page, '\\n\\r\\n\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); + // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 4); + // }); + + // it('viewportY', async () => { + // await openTerminal(page, { rows: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); + // await writeSync(page, '\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 1); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 5); + // await page.evaluate(`window.term.scrollLines(-1)`); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 4); + // await page.evaluate(`window.term.scrollToTop()`); + // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); + // }); + + // it('baseY', async () => { + // await openTerminal(page, { rows: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 0); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 0); + // await writeSync(page, '\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 1); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); + // await page.evaluate(`window.term.scrollLines(-1)`); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); + // await page.evaluate(`window.term.scrollToTop()`); + // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); + // }); + + // it('length', async () => { + // await openTerminal(page, { rows: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 5); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 5); + // await writeSync(page, '\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 6); + // await writeSync(page, '\\n\\n\\n\\n'); + // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 10); + // }); + + // describe('getLine', () => { + // it('invalid index', async () => { + // await openTerminal(page, { rows: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(-1)`), undefined); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(5)`), undefined); + // }); + + // it('isWrapped', async () => { + // await openTerminal(page, { cols: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), false); + // await writeSync(page, 'abcde'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), false); + // await writeSync(page, 'f'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), true); + // }); + + // it('translateToString', async () => { + // await openTerminal(page, { cols: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), ' '); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), ''); + // await writeSync(page, 'foo'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'foo '); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), 'foo'); + // await writeSync(page, 'bar'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'fooba'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), 'fooba'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).translateToString(true)`), 'r'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(false, 1)`), 'ooba'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(false, 1, 3)`), 'oo'); + // }); + + // it('getCell', async () => { + // await openTerminal(page, { cols: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(-1)`), undefined); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(5)`), undefined); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getChars()`), ''); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getWidth()`), 1); + // await writeSync(page, 'a文'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getChars()`), 'a'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getWidth()`), 1); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(1).getChars()`), '文'); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(1).getWidth()`), 2); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(2).getChars()`), ''); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(2).getWidth()`), 0); + // }); + // }); + + // it('active, normal, alternate', async () => { + // await openTerminal(page, { cols: 5 }); + // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'normal'); + // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + + // await writeSync(page, 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0)`), undefined); + + // await writeSync(page, '\\x1b[?47h\\r'); // use alternate screen buffer + // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'alternate'); + // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), ' '); + // await writeSync(page, 'alt '); + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'alt '); + // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0).translateToString()`), 'alt '); + + // await writeSync(page, '\\x1b[?47l\\r'); // use normal screen buffer + // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'normal'); + // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + + // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); + // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0)`), undefined); + // }); + // }); + + // it('dispose', async () => { + // await page.evaluate(` + // window.term = new Terminal(); + // window.term.dispose(); + // `); + // assert.equal(await page.evaluate(`window.term._core._isDisposed`), true); + // }); + + // it('dispose (opened)', async () => { + // await openTerminal(page); + // await page.evaluate(`window.term.dispose()`); + // assert.equal(await page.evaluate(`window.term._core._isDisposed`), true); + // }); +}); + +function writeSync(text: string | Uint8Array): Promise { + return new Promise(r => term.write(text, r)); +} + +function writelnSync(text: string | Uint8Array): Promise { + return new Promise(r => term.writeln(text, r)); +} + +function lineEquals(index: number, text: string): void { + strictEqual(term.buffer.active.getLine(index)!.translateToString(true), text); +} diff --git a/test/api/Terminal.api.ts b/test/api/Terminal.api.ts index 9e951ffe..75399b73 100644 --- a/test/api/Terminal.api.ts +++ b/test/api/Terminal.api.ts @@ -69,12 +69,9 @@ describe('API Integration Tests', function(): void { it('write - bytes (UTF8)', async () => { await openTerminal(page); await page.evaluate(` - // foo - window.term.write(new Uint8Array([102, 111, 111])); - // bar - window.term.write(new Uint8Array([98, 97, 114])); - // 文 - window.term.write(new Uint8Array([230, 150, 135])); + window.term.write(new Uint8Array([102, 111, 111])); // foo + window.term.write(new Uint8Array([98, 97, 114])); // bar + window.term.write(new Uint8Array([230, 150, 135])); // 文 `); await pollFor(page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foobar文'); }); @@ -82,12 +79,9 @@ describe('API Integration Tests', function(): void { it('write - bytes (UTF8) with callback', async () => { await openTerminal(page); await page.evaluate(` - // foo - window.term.write(new Uint8Array([102, 111, 111]), () => { window.__x = 'A'; }); - // bar - window.term.write(new Uint8Array([98, 97, 114]), () => { window.__x += 'B'; }); - // 文 - window.term.write(new Uint8Array([230, 150, 135]), () => { window.__x += 'C'; }); + window.term.write(new Uint8Array([102, 111, 111]), () => { window.__x = 'A'; }); // foo + window.term.write(new Uint8Array([98, 97, 114]), () => { window.__x += 'B'; }); // bar + window.term.write(new Uint8Array([230, 150, 135]), () => { window.__x += 'C'; }); // 文 `); await pollFor(page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foobar文'); await pollFor(page, `window.__x`, 'ABC'); From df48e9f6d5f54f30ad4b2fe15f0d978f68adef9d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 05:52:40 -0700 Subject: [PATCH 36/42] Headless event tests --- src/browser/public/Terminal.ts | 14 +- src/headless/public/Terminal.test.ts | 348 ++++++++------------------- src/headless/public/Terminal.ts | 10 +- typings/xterm-headless.d.ts | 13 + typings/xterm.d.ts | 38 +-- 5 files changed, 143 insertions(+), 280 deletions(-) diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index 8b7b5d2e..6af9db71 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -30,17 +30,17 @@ export class Terminal implements ITerminalApi { } } - public get onCursorMove(): IEvent { return this._core.onCursorMove; } - public get onLineFeed(): IEvent { return this._core.onLineFeed; } - public get onSelectionChange(): IEvent { return this._core.onSelectionChange; } - public get onData(): IEvent { return this._core.onData; } - public get onBinary(): IEvent { return this._core.onBinary; } - public get onTitleChange(): IEvent { return this._core.onTitleChange; } public get onBell(): IEvent { return this._core.onBell; } - public get onScroll(): IEvent { return this._core.onScroll; } + public get onBinary(): IEvent { return this._core.onBinary; } + public get onCursorMove(): IEvent { return this._core.onCursorMove; } + public get onData(): IEvent { return this._core.onData; } public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; } + public get onLineFeed(): IEvent { return this._core.onLineFeed; } public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; } public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; } + public get onScroll(): IEvent { return this._core.onScroll; } + public get onSelectionChange(): IEvent { return this._core.onSelectionChange; } + public get onTitleChange(): IEvent { return this._core.onTitleChange; } public get element(): HTMLElement | undefined { return this._core.element; } public get parser(): IParser { diff --git a/src/headless/public/Terminal.test.ts b/src/headless/public/Terminal.test.ts index 9f45b78e..f70a8127 100644 --- a/src/headless/public/Terminal.test.ts +++ b/src/headless/public/Terminal.test.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { strictEqual, throws } from 'assert'; +import { deepStrictEqual, strictEqual, throws } from 'assert'; import { Terminal } from 'headless/public/Terminal'; let term: Terminal; @@ -113,265 +113,113 @@ describe.only('Headless API Tests', function(): void { } }); - // it('getOption, setOption', async () => { - // await openTerminal(page); - // assert.equal(await page.evaluate(`window.term.getOption('rendererType')`), 'canvas'); - // await page.evaluate(`window.term.setOption('rendererType', 'dom')`); - // assert.equal(await page.evaluate(`window.term.getOption('rendererType')`), 'dom'); - // }); + it('getOption, setOption', async () => { + strictEqual(term.getOption('scrollback'), 1000); + term.setOption('scrollback', 50); + strictEqual(term.getOption('scrollback'), 50); + }); - // describe('renderer', () => { - // it('foreground', async () => { - // await openTerminal(page, { rendererType: 'dom' }); - // await writeSync(page, '\\x1b[30m0\\x1b[31m1\\x1b[32m2\\x1b[33m3\\x1b[34m4\\x1b[35m5\\x1b[36m6\\x1b[37m7'); - // await pollFor(page, `document.querySelectorAll('.xterm-rows > :nth-child(1) > *').length`, 9); - // assert.deepEqual(await page.evaluate(` - // [ - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(1)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(2)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(3)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(4)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(5)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(6)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(7)').className - // ] - // `), [ - // 'xterm-fg-0', - // 'xterm-fg-1', - // 'xterm-fg-2', - // 'xterm-fg-3', - // 'xterm-fg-4', - // 'xterm-fg-5', - // 'xterm-fg-6' - // ]); - // }); + describe('loadAddon', () => { + it('constructor', async () => { + term = new Terminal({ cols: 5 }); + let cols = 0; + term.loadAddon({ + activate: (t) => cols = t.cols, + dispose: () => {} + }); + strictEqual(cols, 5); + }); - // it('background', async () => { - // await openTerminal(page, { rendererType: 'dom' }); - // await writeSync(page, '\\x1b[40m0\\x1b[41m1\\x1b[42m2\\x1b[43m3\\x1b[44m4\\x1b[45m5\\x1b[46m6\\x1b[47m7'); - // await pollFor(page, `document.querySelectorAll('.xterm-rows > :nth-child(1) > *').length`, 9); - // assert.deepEqual(await page.evaluate(` - // [ - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(1)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(2)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(3)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(4)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(5)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(6)').className, - // document.querySelector('.xterm-rows > :nth-child(1) > :nth-child(7)').className - // ] - // `), [ - // 'xterm-bg-0', - // 'xterm-bg-1', - // 'xterm-bg-2', - // 'xterm-bg-3', - // 'xterm-bg-4', - // 'xterm-bg-5', - // 'xterm-bg-6' - // ]); - // }); - // }); + it('dispose (addon)', async () => { + let disposeCalled = false; + const addon = { + activate: () => {}, + dispose: () => disposeCalled = true + }; + term.loadAddon(addon); + strictEqual(disposeCalled, false); + addon.dispose(); + strictEqual(disposeCalled, true); + }); - // it('selection', async () => { - // await openTerminal(page, { rows: 5, cols: 5 }); - // await writeSync(page, `\\n\\nfoo\\n\\n\\rbar\\n\\n\\rbaz`); - // assert.equal(await page.evaluate(`window.term.hasSelection()`), false); - // assert.equal(await page.evaluate(`window.term.getSelection()`), ''); - // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), undefined); - // await page.evaluate(`window.term.selectAll()`); - // assert.equal(await page.evaluate(`window.term.hasSelection()`), true); - // if (process.platform === 'win32') { - // assert.equal(await page.evaluate(`window.term.getSelection()`), '\r\n\r\nfoo\r\n\r\nbar\r\n\r\nbaz'); - // } else { - // assert.equal(await page.evaluate(`window.term.getSelection()`), '\n\nfoo\n\nbar\n\nbaz'); - // } - // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), { startColumn: 0, startRow: 0, endColumn: 5, endRow: 6 }); - // await page.evaluate(`window.term.clearSelection()`); - // assert.equal(await page.evaluate(`window.term.hasSelection()`), false); - // assert.equal(await page.evaluate(`window.term.getSelection()`), ''); - // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), undefined); - // await page.evaluate(`window.term.select(1, 2, 2)`); - // assert.equal(await page.evaluate(`window.term.hasSelection()`), true); - // assert.equal(await page.evaluate(`window.term.getSelection()`), 'oo'); - // assert.deepEqual(await page.evaluate(`window.term.getSelectionPosition()`), { startColumn: 1, startRow: 2, endColumn: 3, endRow: 2 }); - // }); + it('dispose (terminal)', async () => { + let disposeCalled = false; + term.loadAddon({ + activate: () => {}, + dispose: () => disposeCalled = true + }); + strictEqual(disposeCalled, false); + term.dispose(); + strictEqual(disposeCalled, true); + }); + }); - // it('focus, blur', async () => { - // await openTerminal(page); - // assert.equal(await page.evaluate(`document.activeElement.className`), ''); - // await page.evaluate(`window.term.focus()`); - // assert.equal(await page.evaluate(`document.activeElement.className`), 'xterm-helper-textarea'); - // await page.evaluate(`window.term.blur()`); - // assert.equal(await page.evaluate(`document.activeElement.className`), ''); - // }); + describe('Events', () => { + it('onCursorMove', async () => { + let callCount = 0; + term.onCursorMove(e => callCount++); + await writeSync('foo'); + strictEqual(callCount, 1); + await writeSync('bar'); + strictEqual(callCount, 2); + }); - // describe('loadAddon', () => { - // it('constructor', async () => { - // await openTerminal(page, { cols: 5 }); - // await page.evaluate(` - // window.cols = 0; - // window.term.loadAddon({ - // activate: (t) => window.cols = t.cols, - // dispose: () => {} - // }); - // `); - // assert.equal(await page.evaluate(`window.cols`), 5); - // }); + it('onData', async () => { + const calls: string[] = []; + term.onData(e => calls.push(e)); + await writeSync('\x1b[5n'); // DSR Status Report + deepStrictEqual(calls, ['\x1b[0n']); + }); - // it('dispose (addon)', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.disposeCalled = false - // window.addon = { - // activate: () => {}, - // dispose: () => window.disposeCalled = true - // }; - // window.term.loadAddon(window.addon); - // `); - // assert.equal(await page.evaluate(`window.disposeCalled`), false); - // await page.evaluate(`window.addon.dispose()`); - // assert.equal(await page.evaluate(`window.disposeCalled`), true); - // }); + it('onLineFeed', async () => { + let callCount = 0; + term.onLineFeed(() => callCount++); + await writelnSync('foo'); + strictEqual(callCount, 1); + await writelnSync('bar'); + strictEqual(callCount, 2); + }); - // it('dispose (terminal)', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.disposeCalled = false - // window.term.loadAddon({ - // activate: () => {}, - // dispose: () => window.disposeCalled = true - // }); - // `); - // assert.equal(await page.evaluate(`window.disposeCalled`), false); - // await page.evaluate(`window.term.dispose()`); - // assert.equal(await page.evaluate(`window.disposeCalled`), true); - // }); - // }); + it('onScroll', async () => { + term = new Terminal({ rows: 5 }); + const calls: number[] = []; + term.onScroll(e => calls.push(e)); + for (let i = 0; i < 4; i++) { + await writelnSync('foo'); + } + deepStrictEqual(calls, []); + await writelnSync('bar'); + deepStrictEqual(calls, [1]); + await writelnSync('baz'); + deepStrictEqual(calls, [1, 2]); + }); - // describe('Events', () => { - // it('onCursorMove', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.callCount = 0; - // window.term.onCursorMove(e => window.callCount++); - // window.term.write('foo'); - // `); - // await pollFor(page, `window.callCount`, 1); - // await page.evaluate(`window.term.write('bar')`); - // await pollFor(page, `window.callCount`, 2); - // }); + it('onResize', async () => { + const calls: [number, number][] = []; + term.onResize(e => calls.push([e.cols, e.rows])); + deepStrictEqual(calls, []); + term.resize(10, 5); + deepStrictEqual(calls, [[10, 5]]); + term.resize(20, 15); + deepStrictEqual(calls, [[10, 5], [20, 15]]); + }); - // it('onData', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.calls = []; - // window.term.onData(e => calls.push(e)); - // `); - // await page.type('.xterm-helper-textarea', 'foo'); - // assert.deepEqual(await page.evaluate(`window.calls`), ['f', 'o', 'o']); - // }); + it('onTitleChange', async () => { + const calls: string[] = []; + term.onTitleChange(e => calls.push(e)); + deepStrictEqual(calls, []); + await writeSync('\x1b]2;foo\x9c'); + deepStrictEqual(calls, ['foo']); + }); - // it('onKey', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.calls = []; - // window.term.onKey(e => calls.push(e.key)); - // `); - // await page.type('.xterm-helper-textarea', 'foo'); - // assert.deepEqual(await page.evaluate(`window.calls`), ['f', 'o', 'o']); - // }); - - // it('onLineFeed', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.callCount = 0; - // window.term.onLineFeed(() => callCount++); - // window.term.writeln('foo'); - // `); - // await pollFor(page, `window.callCount`, 1); - // await page.evaluate(`window.term.writeln('bar')`); - // await pollFor(page, `window.callCount`, 2); - // }); - - // it('onScroll', async () => { - // await openTerminal(page, { rows: 5 }); - // await page.evaluate(` - // window.calls = []; - // window.term.onScroll(e => window.calls.push(e)); - // for (let i = 0; i < 4; i++) { - // window.term.writeln('foo'); - // } - // `); - // await pollFor(page, `window.calls`, []); - // await page.evaluate(`window.term.writeln('bar')`); - // await pollFor(page, `window.calls`, [1]); - // await page.evaluate(`window.term.writeln('baz')`); - // await pollFor(page, `window.calls`, [1, 2]); - // }); - - // it('onSelectionChange', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.callCount = 0; - // window.term.onSelectionChange(() => window.callCount++); - // `); - // await pollFor(page, `window.callCount`, 0); - // await page.evaluate(`window.term.selectAll()`); - // await pollFor(page, `window.callCount`, 1); - // await page.evaluate(`window.term.clearSelection()`); - // await pollFor(page, `window.callCount`, 2); - // }); - - // it('onRender', async function(): Promise { - // this.retries(3); - // await openTerminal(page); - // await timeout(20); // Ensure all init events are fired - // await page.evaluate(` - // window.calls = []; - // window.term.onRender(e => window.calls.push([e.start, e.end])); - // `); - // await pollFor(page, `window.calls`, []); - // await page.evaluate(`window.term.write('foo')`); - // await pollFor(page, `window.calls`, [[0, 0]]); - // await page.evaluate(`window.term.write('bar\\n\\nbaz')`); - // await pollFor(page, `window.calls`, [[0, 0], [0, 2]]); - // }); - - // it('onResize', async () => { - // await openTerminal(page); - // await timeout(20); // Ensure all init events are fired - // await page.evaluate(` - // window.calls = []; - // window.term.onResize(e => window.calls.push([e.cols, e.rows])); - // `); - // await pollFor(page, `window.calls`, []); - // await page.evaluate(`window.term.resize(10, 5)`); - // await pollFor(page, `window.calls`, [[10, 5]]); - // await page.evaluate(`window.term.resize(20, 15)`); - // await pollFor(page, `window.calls`, [[10, 5], [20, 15]]); - // }); - - // it('onTitleChange', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.calls = []; - // window.term.onTitleChange(e => window.calls.push(e)); - // `); - // await pollFor(page, `window.calls`, []); - // await page.evaluate(`window.term.write('\\x1b]2;foo\\x9c')`); - // await pollFor(page, `window.calls`, ['foo']); - // }); - // it('onBell', async () => { - // await openTerminal(page); - // await page.evaluate(` - // window.calls = []; - // window.term.onBell(() => window.calls.push(true)); - // `); - // await pollFor(page, `window.calls`, []); - // await page.evaluate(`window.term.write('\\x07')`); - // await pollFor(page, `window.calls`, [true]); - // }); - // }); + it('onBell', async () => { + const calls: boolean[] = []; + term.onBell(() => calls.push(true)); + deepStrictEqual(calls, []); + await writeSync('\x07'); + deepStrictEqual(calls, [true]); + }); + }); // describe('buffer', () => { // it('cursorX, cursorY', async () => { diff --git a/src/headless/public/Terminal.ts b/src/headless/public/Terminal.ts index f14bdd55..7a92da15 100644 --- a/src/headless/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -28,12 +28,14 @@ export class Terminal implements ITerminalApi { } } - public get onCursorMove(): IEvent { return this._core.onCursorMove; } - public get onLineFeed(): IEvent { return this._core.onLineFeed; } - public get onData(): IEvent { return this._core.onData; } + public get onBell(): IEvent { return this._core.onBell; } public get onBinary(): IEvent { return this._core.onBinary; } - public get onTitleChange(): IEvent { return this._core.onTitleChange; } + public get onCursorMove(): IEvent { return this._core.onCursorMove; } + public get onData(): IEvent { return this._core.onData; } + public get onLineFeed(): IEvent { return this._core.onLineFeed; } public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; } + public get onScroll(): IEvent { return this._core.onScroll; } + public get onTitleChange(): IEvent { return this._core.onTitleChange; } public get parser(): IParser { this._checkProposedApi(); diff --git a/typings/xterm-headless.d.ts b/typings/xterm-headless.d.ts index 3dd9d69e..66d8f191 100644 --- a/typings/xterm-headless.d.ts +++ b/typings/xterm-headless.d.ts @@ -533,6 +533,12 @@ declare module 'xterm-headless' { */ constructor(options?: ITerminalOptions); + /** + * Adds an event listener for when the bell is triggered. + * @returns an `IDisposable` to stop listening. + */ + onBell: IEvent; + /** * Adds an event listener for when a binary event fires. This is used to * enable non UTF-8 conformant binary messages to be sent to the backend. @@ -572,6 +578,13 @@ declare module 'xterm-headless' { */ onResize: IEvent<{ cols: number, rows: number }>; + /** + * Adds an event listener for when a scroll occurs. The event value is the + * new position of the viewport. + * @returns an `IDisposable` to stop listening. + */ + onScroll: IEvent; + /** * Adds an event listener for when an OSC 0 or OSC 2 title change occurs. * The event value is the new title. diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 6bfb71ae..035748fc 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -634,6 +634,12 @@ declare module 'xterm' { */ constructor(options?: ITerminalOptions); + /** + * Adds an event listener for when the bell is triggered. + * @returns an `IDisposable` to stop listening. + */ + onBell: IEvent; + /** * Adds an event listener for when a binary event fires. This is used to * enable non UTF-8 conformant binary messages to be sent to the backend. @@ -674,19 +680,6 @@ declare module 'xterm' { */ onLineFeed: IEvent; - /** - * Adds an event listener for when a scroll occurs. The event value is the - * new position of the viewport. - * @returns an `IDisposable` to stop listening. - */ - onScroll: IEvent; - - /** - * Adds an event listener for when a selection change occurs. - * @returns an `IDisposable` to stop listening. - */ - onSelectionChange: IEvent; - /** * Adds an event listener for when rows are rendered. The event value * contains the start row and end rows of the rendered area (ranges from `0` @@ -702,6 +695,19 @@ declare module 'xterm' { */ onResize: IEvent<{ cols: number, rows: number }>; + /** + * Adds an event listener for when a scroll occurs. The event value is the + * new position of the viewport. + * @returns an `IDisposable` to stop listening. + */ + onScroll: IEvent; + + /** + * Adds an event listener for when a selection change occurs. + * @returns an `IDisposable` to stop listening. + */ + onSelectionChange: IEvent; + /** * Adds an event listener for when an OSC 0 or OSC 2 title change occurs. * The event value is the new title. @@ -709,12 +715,6 @@ declare module 'xterm' { */ onTitleChange: IEvent; - /** - * Adds an event listener for when the bell is triggered. - * @returns an `IDisposable` to stop listening. - */ - onBell: IEvent; - /** * Unfocus the terminal. */ From f8066d6dee944799fc10ae118501f6515ca16700 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 06:00:55 -0700 Subject: [PATCH 37/42] Full tests for xterm-headless --- src/headless/public/Terminal.test.ts | 283 +++++++++++++-------------- src/headless/public/Terminal.ts | 18 ++ typings/xterm-headless.d.ts | 28 +++ 3 files changed, 183 insertions(+), 146 deletions(-) diff --git a/src/headless/public/Terminal.test.ts b/src/headless/public/Terminal.test.ts index f70a8127..15e1efba 100644 --- a/src/headless/public/Terminal.test.ts +++ b/src/headless/public/Terminal.test.ts @@ -8,7 +8,7 @@ import { Terminal } from 'headless/public/Terminal'; let term: Terminal; -describe.only('Headless API Tests', function(): void { +describe('Headless API Tests', function(): void { beforeEach(() => { // Create default terminal to be used by most tests term = new Terminal(); @@ -221,165 +221,156 @@ describe.only('Headless API Tests', function(): void { }); }); - // describe('buffer', () => { - // it('cursorX, cursorY', async () => { - // await openTerminal(page, { rows: 5, cols: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 0); - // await writeSync(page, 'foo'); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 3); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 0); - // await writeSync(page, '\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 3); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); - // await writeSync(page, '\\r'); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); - // await writeSync(page, 'abcde'); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 5); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 1); - // await writeSync(page, '\\n\\r\\n\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorX`), 0); - // assert.equal(await page.evaluate(`window.term.buffer.active.cursorY`), 4); - // }); + describe('buffer', () => { + it('cursorX, cursorY', async () => { + term = new Terminal({ rows: 5, cols: 5 }); + strictEqual(term.buffer.active.cursorX, 0); + strictEqual(term.buffer.active.cursorY, 0); + await writeSync('foo'); + strictEqual(term.buffer.active.cursorX, 3); + strictEqual(term.buffer.active.cursorY, 0); + await writeSync('\n'); + strictEqual(term.buffer.active.cursorX, 3); + strictEqual(term.buffer.active.cursorY, 1); + await writeSync('\r'); + strictEqual(term.buffer.active.cursorX, 0); + strictEqual(term.buffer.active.cursorY, 1); + await writeSync('abcde'); + strictEqual(term.buffer.active.cursorX, 5); + strictEqual(term.buffer.active.cursorY, 1); + await writeSync('\n\r\n\n\n\n\n'); + strictEqual(term.buffer.active.cursorX, 0); + strictEqual(term.buffer.active.cursorY, 4); + }); - // it('viewportY', async () => { - // await openTerminal(page, { rows: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); - // await writeSync(page, '\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 1); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 5); - // await page.evaluate(`window.term.scrollLines(-1)`); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 4); - // await page.evaluate(`window.term.scrollToTop()`); - // assert.equal(await page.evaluate(`window.term.buffer.active.viewportY`), 0); - // }); + it('viewportY', async () => { + term = new Terminal({ rows: 5 }); + strictEqual(term.buffer.active.viewportY, 0); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.viewportY, 0); + await writeSync('\n'); + strictEqual(term.buffer.active.viewportY, 1); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.viewportY, 5); + term.scrollLines(-1); + strictEqual(term.buffer.active.viewportY, 4); + term.scrollToTop(); + strictEqual(term.buffer.active.viewportY, 0); + }); - // it('baseY', async () => { - // await openTerminal(page, { rows: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 0); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 0); - // await writeSync(page, '\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 1); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); - // await page.evaluate(`window.term.scrollLines(-1)`); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); - // await page.evaluate(`window.term.scrollToTop()`); - // assert.equal(await page.evaluate(`window.term.buffer.active.baseY`), 5); - // }); + it('baseY', async () => { + term = new Terminal({ rows: 5 }); + strictEqual(term.buffer.active.baseY, 0); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.baseY, 0); + await writeSync('\n'); + strictEqual(term.buffer.active.baseY, 1); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.baseY, 5); + term.scrollLines(-1); + strictEqual(term.buffer.active.baseY, 5); + term.scrollToTop(); + strictEqual(term.buffer.active.baseY, 5); + }); - // it('length', async () => { - // await openTerminal(page, { rows: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 5); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 5); - // await writeSync(page, '\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 6); - // await writeSync(page, '\\n\\n\\n\\n'); - // assert.equal(await page.evaluate(`window.term.buffer.active.length`), 10); - // }); + it('length', async () => { + term = new Terminal({ rows: 5 }); + strictEqual(term.buffer.active.length, 5); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.length, 5); + await writeSync('\n'); + strictEqual(term.buffer.active.length, 6); + await writeSync('\n\n\n\n'); + strictEqual(term.buffer.active.length, 10); + }); - // describe('getLine', () => { - // it('invalid index', async () => { - // await openTerminal(page, { rows: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(-1)`), undefined); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(5)`), undefined); - // }); + describe('getLine', () => { + it('invalid index', async () => { + term = new Terminal({ rows: 5 }); + strictEqual(term.buffer.active.getLine(-1), undefined); + strictEqual(term.buffer.active.getLine(5), undefined); + }); - // it('isWrapped', async () => { - // await openTerminal(page, { cols: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), false); - // await writeSync(page, 'abcde'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), false); - // await writeSync(page, 'f'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).isWrapped`), false); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).isWrapped`), true); - // }); + it('isWrapped', async () => { + term = new Terminal({ cols: 5 }); + strictEqual(term.buffer.active.getLine(0)!.isWrapped, false); + strictEqual(term.buffer.active.getLine(1)!.isWrapped, false); + await writeSync('abcde'); + strictEqual(term.buffer.active.getLine(0)!.isWrapped, false); + strictEqual(term.buffer.active.getLine(1)!.isWrapped, false); + await writeSync('f'); + strictEqual(term.buffer.active.getLine(0)!.isWrapped, false); + strictEqual(term.buffer.active.getLine(1)!.isWrapped, true); + }); - // it('translateToString', async () => { - // await openTerminal(page, { cols: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), ' '); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), ''); - // await writeSync(page, 'foo'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'foo '); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), 'foo'); - // await writeSync(page, 'bar'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'fooba'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(true)`), 'fooba'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(1).translateToString(true)`), 'r'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(false, 1)`), 'ooba'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString(false, 1, 3)`), 'oo'); - // }); + it('translateToString', async () => { + term = new Terminal({ cols: 5 }); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), ' '); + strictEqual(term.buffer.active.getLine(0)!.translateToString(true), ''); + await writeSync('foo'); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), 'foo '); + strictEqual(term.buffer.active.getLine(0)!.translateToString(true), 'foo'); + await writeSync('bar'); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), 'fooba'); + strictEqual(term.buffer.active.getLine(0)!.translateToString(true), 'fooba'); + strictEqual(term.buffer.active.getLine(1)!.translateToString(true), 'r'); + strictEqual(term.buffer.active.getLine(0)!.translateToString(false, 1), 'ooba'); + strictEqual(term.buffer.active.getLine(0)!.translateToString(false, 1, 3), 'oo'); + }); - // it('getCell', async () => { - // await openTerminal(page, { cols: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(-1)`), undefined); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(5)`), undefined); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getChars()`), ''); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getWidth()`), 1); - // await writeSync(page, 'a文'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getChars()`), 'a'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(0).getWidth()`), 1); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(1).getChars()`), '文'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(1).getWidth()`), 2); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(2).getChars()`), ''); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).getCell(2).getWidth()`), 0); - // }); - // }); + it('getCell', async () => { + term = new Terminal({ cols: 5 }); + strictEqual(term.buffer.active.getLine(0)!.getCell(-1), undefined); + strictEqual(term.buffer.active.getLine(0)!.getCell(5), undefined); + strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getChars(), ''); + strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getWidth(), 1); + await writeSync('a文'); + strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getChars(), 'a'); + strictEqual(term.buffer.active.getLine(0)!.getCell(0)!.getWidth(), 1); + strictEqual(term.buffer.active.getLine(0)!.getCell(1)!.getChars(), '文'); + strictEqual(term.buffer.active.getLine(0)!.getCell(1)!.getWidth(), 2); + strictEqual(term.buffer.active.getLine(0)!.getCell(2)!.getChars(), ''); + strictEqual(term.buffer.active.getLine(0)!.getCell(2)!.getWidth(), 0); + }); + }); - // it('active, normal, alternate', async () => { - // await openTerminal(page, { cols: 5 }); - // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'normal'); - // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + it('active, normal, alternate', async () => { + term = new Terminal({ cols: 5 }); + strictEqual(term.buffer.active.type, 'normal'); + strictEqual(term.buffer.normal.type, 'normal'); + strictEqual(term.buffer.alternate.type, 'alternate'); - // await writeSync(page, 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0)`), undefined); + await writeSync('norm '); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), 'norm '); + strictEqual(term.buffer.normal.getLine(0)!.translateToString(), 'norm '); + strictEqual(term.buffer.alternate.getLine(0), undefined); - // await writeSync(page, '\\x1b[?47h\\r'); // use alternate screen buffer - // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'alternate'); - // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + await writeSync('\x1b[?47h\r'); // use alternate screen buffer + strictEqual(term.buffer.active.type, 'alternate'); + strictEqual(term.buffer.normal.type, 'normal'); + strictEqual(term.buffer.alternate.type, 'alternate'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), ' '); - // await writeSync(page, 'alt '); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'alt '); - // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0).translateToString()`), 'alt '); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), ' '); + await writeSync('alt '); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), 'alt '); + strictEqual(term.buffer.normal.getLine(0)!.translateToString(), 'norm '); + strictEqual(term.buffer.alternate.getLine(0)!.translateToString(), 'alt '); - // await writeSync(page, '\\x1b[?47l\\r'); // use normal screen buffer - // assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'normal'); - // assert.equal(await page.evaluate(`window.term.buffer.normal.type`), 'normal'); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.type`), 'alternate'); + await writeSync('\x1b[?47l\r'); // use normal screen buffer + strictEqual(term.buffer.active.type, 'normal'); + strictEqual(term.buffer.normal.type, 'normal'); + strictEqual(term.buffer.alternate.type, 'alternate'); - // assert.equal(await page.evaluate(`window.term.buffer.active.getLine(0).translateToString()`), 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.normal.getLine(0).translateToString()`), 'norm '); - // assert.equal(await page.evaluate(`window.term.buffer.alternate.getLine(0)`), undefined); - // }); - // }); + strictEqual(term.buffer.active.getLine(0)!.translateToString(), 'norm '); + strictEqual(term.buffer.normal.getLine(0)!.translateToString(), 'norm '); + strictEqual(term.buffer.alternate.getLine(0), undefined); + }); + }); - // it('dispose', async () => { - // await page.evaluate(` - // window.term = new Terminal(); - // window.term.dispose(); - // `); - // assert.equal(await page.evaluate(`window.term._core._isDisposed`), true); - // }); - - // it('dispose (opened)', async () => { - // await openTerminal(page); - // await page.evaluate(`window.term.dispose()`); - // assert.equal(await page.evaluate(`window.term._core._isDisposed`), true); - // }); + it('dispose', async () => { + term.dispose(); + strictEqual((term as any)._core._isDisposed, true); + }); }); function writeSync(text: string | Uint8Array): Promise { diff --git a/src/headless/public/Terminal.ts b/src/headless/public/Terminal.ts index 7a92da15..a1de7fdb 100644 --- a/src/headless/public/Terminal.ts +++ b/src/headless/public/Terminal.ts @@ -77,6 +77,24 @@ export class Terminal implements ITerminalApi { this._addonManager.dispose(); this._core.dispose(); } + public scrollLines(amount: number): void { + this._verifyIntegers(amount); + this._core.scrollLines(amount); + } + public scrollPages(pageCount: number): void { + this._verifyIntegers(pageCount); + this._core.scrollPages(pageCount); + } + public scrollToTop(): void { + this._core.scrollToTop(); + } + public scrollToBottom(): void { + this._core.scrollToBottom(); + } + public scrollToLine(line: number): void { + this._verifyIntegers(line); + this._core.scrollToLine(line); + } public clear(): void { this._core.clear(); } diff --git a/typings/xterm-headless.d.ts b/typings/xterm-headless.d.ts index 66d8f191..03e7567a 100644 --- a/typings/xterm-headless.d.ts +++ b/typings/xterm-headless.d.ts @@ -620,6 +620,34 @@ declare module 'xterm-headless' { */ dispose(): void; + /** + * Scroll the display of the terminal + * @param amount The number of lines to scroll down (negative scroll up). + */ + scrollLines(amount: number): void; + + /** + * Scroll the display of the terminal by a number of pages. + * @param pageCount The number of pages to scroll (negative scrolls up). + */ + scrollPages(pageCount: number): void; + + /** + * Scrolls the display of the terminal to the top. + */ + scrollToTop(): void; + + /** + * Scrolls the display of the terminal to the bottom. + */ + scrollToBottom(): void; + + /** + * Scrolls to a line within the buffer. + * @param line The 0-based line index to scroll to. + */ + scrollToLine(line: number): void; + /** * Clear the entire buffer, making the prompt line the new first line. */ From f45f5b4b9f7f9923124f44f9f5d71afbde6ad068 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 06:11:30 -0700 Subject: [PATCH 38/42] Remove unneeded manual headless test --- headless/test/README.md | 9 --------- headless/test/index.js | 12 ------------ headless/test/package.json | 11 ----------- 3 files changed, 32 deletions(-) delete mode 100644 headless/test/README.md delete mode 100644 headless/test/index.js delete mode 100644 headless/test/package.json diff --git a/headless/test/README.md b/headless/test/README.md deleted file mode 100644 index e48da411..00000000 --- a/headless/test/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This is a basic manual test for 'xterm-headless': - -```sh -# From repo root -yarn build -yarn package-headless -cd headless/test -node index.js -``` diff --git a/headless/test/index.js b/headless/test/index.js deleted file mode 100644 index 021f2ecd..00000000 --- a/headless/test/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import { createRequire } from 'module'; -const require = createRequire(import.meta.url); -const Terminal = require('../headless/lib-headless/xterm.js').Terminal; - -console.log('Creating xterm-headless terminal...'); -const terminal = new Terminal(); -console.log('Writing to terminal...') -terminal.write('foo \x1b[1;31mbar\x1b[0m baz', () => { - const bufferLine = terminal.buffer.normal.getLine(terminal.buffer.normal.cursorY); - const contents = bufferLine.translateToString(true); - console.log(`Contents of terminal active buffer are: ${contents}`); // foo bar baz -}); diff --git a/headless/test/package.json b/headless/test/package.json deleted file mode 100644 index 93549623..00000000 --- a/headless/test/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "test", - "version": "1.0.0", - "description": "", - "main": "index.js", - "type": "module", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "" -} From d694febdbff05268c99a048663be2f82d9fde4bc Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 06:19:15 -0700 Subject: [PATCH 39/42] Polish readme --- headless/README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/headless/README.md b/headless/README.md index 358c97ef..1d2d6156 100644 --- a/headless/README.md +++ b/headless/README.md @@ -1,5 +1,31 @@ # [![xterm.js logo](logo-full.png)](https://xtermjs.org) -⚠ This package is a work in progress +⚠ This package is experimental `xterm-headless` is a headless terminal that can be run in node.js. This is useful in combination with the frontend [`xterm`](https://www.npmjs.com/package/xterm) for example to keep track of a terminal's state on a remote server where the process is hosted. + +## Getting Started + +First, you need to install the module, we ship exclusively through npm, so you need that installed and then add xterm.js as a dependency by running: + +```sh +npm install xterm-headless +``` + +Then import as you would a regular node package. The recommended way to load `xterm-headless` is with TypeScript and the ES6 module syntax: + +```javascript +import { Terminal } from 'xterm-headless'; +``` + +## API + +The full API for `xterm-headless` is contained within the [TypeScript declaration file](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm-headless.d.ts), use the branch/tag picker in GitHub (`w`) to navigate to the correct version of the API. + +Note that some APIs are marked *experimental*, these are added to enable experimentation with new ideas without committing to support it like a normal [semver](https://semver.org/) API. Note that these APIs can change radically between versions, so be sure to read release notes if you plan on using experimental APIs. + +### Addons + +Addons in `xterm-headless` work the [same as in `xterm`](https://github.com/xtermjs/xterm.js/blob/master/README.md#addons) with the one caveat being that the addon needs to be packaged for node.js and not use any DOM APIs. + +Currently no official addons are packaged on npm. From 7f5af09f52279bb973c614ce907c0332fcf6447a Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 06:53:59 -0700 Subject: [PATCH 40/42] Include lib-headless in xterm-headless Part of #3212 --- headless/.npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/headless/.npmignore b/headless/.npmignore index c6b33260..83e9f201 100644 --- a/headless/.npmignore +++ b/headless/.npmignore @@ -1,5 +1,6 @@ # Include !typings/*.d.ts +!lib-headless/ # Exclude test/ From 0a287e01abcf82eb8bebf049f084abdb5c0cef44 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 07:20:38 -0700 Subject: [PATCH 41/42] Run yarn package before publishing Part of #2749 --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c87496b2..5d4e9918 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -164,7 +164,9 @@ jobs: displayName: Cache node modules - script: yarn --frozen-lockfile displayName: 'Install dependencies and build' - - script: node ./bin/package_headless.js + - script: | + yarn package-headless + node ./bin/package_headless.js displayName: 'Package xterm-headless' - script: NPM_AUTH_TOKEN="$(NPM_AUTH_TOKEN)" node ./bin/publish.js displayName: 'Package and publish to npm' From d8899b0b5d461bd2d1d3dd2c63e6ef4223f92d7e Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 12 Aug 2021 12:59:22 -0700 Subject: [PATCH 42/42] Fix eslint errors in test/benchmark --- .../EscapeSequenceParser.benchmark.ts | 172 +++++++++--------- test/benchmark/Terminal.benchmark.ts | 12 +- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/test/benchmark/EscapeSequenceParser.benchmark.ts b/test/benchmark/EscapeSequenceParser.benchmark.ts index c2707f19..10c44797 100644 --- a/test/benchmark/EscapeSequenceParser.benchmark.ts +++ b/test/benchmark/EscapeSequenceParser.benchmark.ts @@ -40,42 +40,42 @@ perfContext('Parser throughput - 50MB data', () => { beforeEach(() => { parser = new EscapeSequenceParser(); parser.setPrintHandler((data, start, end) => {}); - parser.registerCsiHandler({final: '@'}, params => true); - parser.registerCsiHandler({final: 'A'}, params => true); - parser.registerCsiHandler({final: 'B'}, params => true); - parser.registerCsiHandler({final: 'C'}, params => true); - parser.registerCsiHandler({final: 'D'}, params => true); - parser.registerCsiHandler({final: 'E'}, params => true); - parser.registerCsiHandler({final: 'F'}, params => true); - parser.registerCsiHandler({final: 'G'}, params => true); - parser.registerCsiHandler({final: 'H'}, params => true); - parser.registerCsiHandler({final: 'I'}, params => true); - parser.registerCsiHandler({final: 'J'}, params => true); - parser.registerCsiHandler({final: 'K'}, params => true); - parser.registerCsiHandler({final: 'L'}, params => true); - parser.registerCsiHandler({final: 'M'}, params => true); - parser.registerCsiHandler({final: 'P'}, params => true); - parser.registerCsiHandler({final: 'S'}, params => true); - parser.registerCsiHandler({final: 'T'}, params => true); - parser.registerCsiHandler({final: 'X'}, params => true); - parser.registerCsiHandler({final: 'Z'}, params => true); - parser.registerCsiHandler({final: '`'}, params => true); - parser.registerCsiHandler({final: 'a'}, params => true); - parser.registerCsiHandler({final: 'b'}, params => true); - parser.registerCsiHandler({final: 'c'}, params => true); - parser.registerCsiHandler({final: 'd'}, params => true); - parser.registerCsiHandler({final: 'e'}, params => true); - parser.registerCsiHandler({final: 'f'}, params => true); - parser.registerCsiHandler({final: 'g'}, params => true); - parser.registerCsiHandler({final: 'h'}, params => true); - parser.registerCsiHandler({final: 'l'}, params => true); - parser.registerCsiHandler({final: 'm'}, params => true); - parser.registerCsiHandler({final: 'n'}, params => true); - parser.registerCsiHandler({final: 'p'}, params => true); - parser.registerCsiHandler({final: 'q'}, params => true); - parser.registerCsiHandler({final: 'r'}, params => true); - parser.registerCsiHandler({final: 's'}, params => true); - parser.registerCsiHandler({final: 'u'}, params => true); + parser.registerCsiHandler({ final: '@' }, params => true); + parser.registerCsiHandler({ final: 'A' }, params => true); + parser.registerCsiHandler({ final: 'B' }, params => true); + parser.registerCsiHandler({ final: 'C' }, params => true); + parser.registerCsiHandler({ final: 'D' }, params => true); + parser.registerCsiHandler({ final: 'E' }, params => true); + parser.registerCsiHandler({ final: 'F' }, params => true); + parser.registerCsiHandler({ final: 'G' }, params => true); + parser.registerCsiHandler({ final: 'H' }, params => true); + parser.registerCsiHandler({ final: 'I' }, params => true); + parser.registerCsiHandler({ final: 'J' }, params => true); + parser.registerCsiHandler({ final: 'K' }, params => true); + parser.registerCsiHandler({ final: 'L' }, params => true); + parser.registerCsiHandler({ final: 'M' }, params => true); + parser.registerCsiHandler({ final: 'P' }, params => true); + parser.registerCsiHandler({ final: 'S' }, params => true); + parser.registerCsiHandler({ final: 'T' }, params => true); + parser.registerCsiHandler({ final: 'X' }, params => true); + parser.registerCsiHandler({ final: 'Z' }, params => true); + parser.registerCsiHandler({ final: '`' }, params => true); + parser.registerCsiHandler({ final: 'a' }, params => true); + parser.registerCsiHandler({ final: 'b' }, params => true); + parser.registerCsiHandler({ final: 'c' }, params => true); + parser.registerCsiHandler({ final: 'd' }, params => true); + parser.registerCsiHandler({ final: 'e' }, params => true); + parser.registerCsiHandler({ final: 'f' }, params => true); + parser.registerCsiHandler({ final: 'g' }, params => true); + parser.registerCsiHandler({ final: 'h' }, params => true); + parser.registerCsiHandler({ final: 'l' }, params => true); + parser.registerCsiHandler({ final: 'm' }, params => true); + parser.registerCsiHandler({ final: 'n' }, params => true); + parser.registerCsiHandler({ final: 'p' }, params => true); + parser.registerCsiHandler({ final: 'q' }, params => true); + parser.registerCsiHandler({ final: 'r' }, params => true); + parser.registerCsiHandler({ final: 's' }, params => true); + parser.registerCsiHandler({ final: 'u' }, params => true); parser.setExecuteHandler(C0.BEL, () => true); parser.setExecuteHandler(C0.LF, () => true); parser.setExecuteHandler(C0.VT, () => true); @@ -90,24 +90,24 @@ perfContext('Parser throughput - 50MB data', () => { parser.setExecuteHandler(C1.HTS, () => true); parser.registerOscHandler(0, new OscHandler(data => true)); parser.registerOscHandler(1, new FastOscHandler()); - parser.registerEscHandler({final: '7'}, () => true); - parser.registerEscHandler({final: '8'}, () => true); - parser.registerEscHandler({final: 'D'}, () => true); - parser.registerEscHandler({final: 'E'}, () => true); - parser.registerEscHandler({final: 'H'}, () => true); - parser.registerEscHandler({final: 'M'}, () => true); - parser.registerEscHandler({final: '='}, () => true); - parser.registerEscHandler({final: '>'}, () => true); - parser.registerEscHandler({final: 'c'}, () => true); - parser.registerEscHandler({final: 'n'}, () => true); - parser.registerEscHandler({final: 'o'}, () => true); - parser.registerEscHandler({final: '|'}, () => true); - parser.registerEscHandler({final: '}'}, () => true); - parser.registerEscHandler({final: '~'}, () => true); - parser.registerEscHandler({intermediates: '%', final: '@'}, () => true); - parser.registerEscHandler({intermediates: '%', final: 'G'}, () => true); - parser.registerDcsHandler({final: 'p'}, new DcsHandler(data => true)); - parser.registerDcsHandler({final: 'q'}, new FastDcsHandler()); + parser.registerEscHandler({ final: '7' }, () => true); + parser.registerEscHandler({ final: '8' }, () => true); + parser.registerEscHandler({ final: 'D' }, () => true); + parser.registerEscHandler({ final: 'E' }, () => true); + parser.registerEscHandler({ final: 'H' }, () => true); + parser.registerEscHandler({ final: 'M' }, () => true); + parser.registerEscHandler({ final: '=' }, () => true); + parser.registerEscHandler({ final: '>' }, () => true); + parser.registerEscHandler({ final: 'c' }, () => true); + parser.registerEscHandler({ final: 'n' }, () => true); + parser.registerEscHandler({ final: 'o' }, () => true); + parser.registerEscHandler({ final: '|' }, () => true); + parser.registerEscHandler({ final: '}' }, () => true); + parser.registerEscHandler({ final: '~' }, () => true); + parser.registerEscHandler({ intermediates: '%', final: '@' }, () => true); + parser.registerEscHandler({ intermediates: '%', final: 'G' }, () => true); + parser.registerDcsHandler({ final: 'p' }, new DcsHandler(data => true)); + parser.registerDcsHandler({ final: 'q' }, new FastDcsHandler()); }); perfContext('PRINT - a', () => { @@ -121,8 +121,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', async () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('EXECUTE - \\n', () => { @@ -136,8 +136,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('ESCAPE - ESC E', () => { @@ -151,8 +151,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('ESCAPE with collect - ESC % G', () => { @@ -166,8 +166,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('CSI - CSI A', () => { @@ -181,8 +181,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('CSI with collect - CSI ? p', () => { @@ -196,8 +196,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('CSI with params (short) - CSI 1;2 m', () => { @@ -211,8 +211,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('CSI with params (long) - CSI 1;2;3;4;5;6;7;8;9;0 m', () => { @@ -226,8 +226,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('OSC string interface (short seq) - OSC 0;hi ST', () => { @@ -241,8 +241,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('OSC string interface (long seq) - OSC 0; ST', () => { @@ -256,8 +256,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('OSC class interface (short seq) - OSC 0;hi ST', () => { @@ -271,8 +271,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('OSC class interface (long seq) - OSC 0; ST', () => { @@ -286,8 +286,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('DCS string interface (short seq)', () => { @@ -301,8 +301,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', async () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('DCS string interface (long seq)', () => { @@ -316,8 +316,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', async () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('DCS class interface (short seq)', () => { @@ -331,8 +331,8 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', async () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); perfContext('DCS class interface (long seq)', () => { @@ -346,7 +346,7 @@ perfContext('Parser throughput - 50MB data', () => { }); new ThroughputRuntimeCase('', async () => { parser.parse(parsed, parsed.length); - return {payloadSize: parsed.length}; - }, {fork: true}).showAverageThroughput(); + return { payloadSize: parsed.length }; + }, { fork: true }).showAverageThroughput(); }); }); diff --git a/test/benchmark/Terminal.benchmark.ts b/test/benchmark/Terminal.benchmark.ts index 40a3c208..578a83d0 100644 --- a/test/benchmark/Terminal.benchmark.ts +++ b/test/benchmark/Terminal.benchmark.ts @@ -47,22 +47,22 @@ perfContext('Terminal: ls -lR /usr/lib', () => { perfContext('write/string/async', () => { let terminal: Terminal; before(() => { - terminal = new Terminal({cols: 80, rows: 25, scrollback: 1000}); + terminal = new Terminal({ cols: 80, rows: 25, scrollback: 1000 }); }); new ThroughputRuntimeCase('', async () => { await new Promise(res => terminal.write(content, res)); - return {payloadSize: contentUtf8.length}; - }, {fork: false}).showAverageThroughput(); + return { payloadSize: contentUtf8.length }; + }, { fork: false }).showAverageThroughput(); }); perfContext('write/Utf8/async', () => { let terminal: Terminal; before(() => { - terminal = new Terminal({cols: 80, rows: 25, scrollback: 1000}); + terminal = new Terminal({ cols: 80, rows: 25, scrollback: 1000 }); }); new ThroughputRuntimeCase('', async () => { await new Promise(res => terminal.write(content, res)); - return {payloadSize: contentUtf8.length}; - }, {fork: false}).showAverageThroughput(); + return { payloadSize: contentUtf8.length }; + }, { fork: false }).showAverageThroughput(); }); });