Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e83102070b | ||
|
|
ba582efbfa | ||
|
|
6d826ac022 | ||
|
|
5070a08b58 | ||
|
|
8f5c963982 | ||
|
|
eacf90b2b7 | ||
|
|
6ff26d2c7e | ||
|
|
3f39edb025 | ||
|
|
5f3882efe7 | ||
|
|
1d125ac715 |
@@ -2,13 +2,10 @@
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
**Core Structure**: xterm.js is a multi-target terminal emulator with these main source areas:
|
||||
- `src/primitives/`: Building blocks (buffer, parser, input, data, utilities); TypeScript project `src/primitives/tsconfig.json`
|
||||
- `src/runtime/`: Services, `CoreTerminal`, `InputHandler`, public API adapters; TypeScript project `src/runtime/tsconfig.json`
|
||||
- `src/target-browser/`: Browser terminal with DOM rendering
|
||||
- `src/target-headless/`: Node terminal without DOM
|
||||
|
||||
See `src/ARCHITECTURE.md` for the dependency graph and import-path conventions (`common/*`, `target-browser/*`, `target-headless/*`).
|
||||
**Core Structure**: xterm.js is a multi-target terminal emulator with three main distributions:
|
||||
- `src/browser/`: Full-featured browser terminal with DOM rendering
|
||||
- `src/headless/`: Server-side terminal for Node.js (no DOM)
|
||||
- `src/common/`: Shared core logic (parsing, buffer management, terminal state)
|
||||
|
||||
**Key Classes**:
|
||||
- `Terminal` (browser/headless): Public API wrapper
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
"../../../node_modules/@types/mocha"
|
||||
],
|
||||
"paths": {
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-clipboard": [
|
||||
"../typings/addon-clipboard.d.ts"
|
||||
@@ -29,7 +29,7 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { Terminal, ITerminalAddon, IRenderDimensions } from '@xterm/xterm';
|
||||
import type { FitAddon as IFitApi } from '@xterm/addon-fit';
|
||||
import { ViewportConstants } from 'target-browser/shared/Constants';
|
||||
import { ViewportConstants } from 'browser/shared/Constants';
|
||||
|
||||
interface ITerminalDimensions {
|
||||
/**
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
"../../../node_modules/@types/mocha"
|
||||
],
|
||||
"paths": {
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-fit": [
|
||||
"../typings/addon-fit.d.ts"
|
||||
@@ -29,7 +29,7 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { ITerminalAddon, IDisposable } from '@xterm/xterm';
|
||||
import type { ImageAddon as IImageApi } from '@xterm/addon-image';
|
||||
import { Emitter, type IEvent } from 'common/Event';
|
||||
import { Emitter, type IEvent } from 'common/base/Event';
|
||||
import { IIPHandler } from './IIPHandler';
|
||||
import { ImageRenderer } from './ImageRenderer';
|
||||
import { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { toRGBA8888 } from 'sixel/lib/Colors';
|
||||
import { IDisposable } from '@xterm/xterm';
|
||||
import { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';
|
||||
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { Disposable, MutableDisposable, toDisposable } from 'common/base/Lifecycle';
|
||||
|
||||
const enum Constants {
|
||||
PLACEHOLDER_LENGTH = 4096,
|
||||
|
||||
@@ -9,10 +9,11 @@ import { IDisposable, IMarker, Terminal } from '@xterm/xterm';
|
||||
import { Attributes, BgFlags, Content, ExtFlags, UnderlineStyle } from 'common/buffer/Constants';
|
||||
import type { AttributeData } from 'common/buffer/AttributeData';
|
||||
import type { IParams, IDcsHandler, IOscHandler, IApcHandler, IEscapeSequenceParser } from 'common/parser/Types';
|
||||
import type { IBufferLine, IExtendedAttrs, IInputHandler } from 'common/Types';
|
||||
import type { ITerminal, ReadonlyColorSet } from 'target-browser/Types';
|
||||
import type { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import type { ICoreBrowserService, IRenderService, IThemeService } from 'target-browser/services/Services';
|
||||
import type { IBufferLine, IExtendedAttrs } from 'common/buffer/CellTypes';
|
||||
import type { IInputHandler } from 'common/terminal/InputHandlerTypes';
|
||||
import type { ITerminal, ReadonlyColorSet } from 'browser/Types';
|
||||
import type { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
import type { ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
||||
|
||||
export const enum Cell {
|
||||
CONTENT = 0, // codepoint and wcwidth information (enum Content)
|
||||
|
||||
@@ -12,11 +12,8 @@
|
||||
"../../../node_modules/@types/mocha"
|
||||
],
|
||||
"paths": {
|
||||
"target-browser/*": [ "../../../src/target-browser/*" ],
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
],
|
||||
"browser/*": [ "../../../src/browser/*" ],
|
||||
"common/*": [ "../../../src/common/*" ],
|
||||
"@xterm/addon-image": [ "../typings/addon-image.d.ts" ],
|
||||
"*": [ "./*" ]
|
||||
}
|
||||
@@ -26,7 +23,7 @@
|
||||
"../../../typings/xterm.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../../../src/target-browser" },
|
||||
{ "path": "../../../src" }
|
||||
{ "path": "../../../src/browser" },
|
||||
{ "path": "../../../src/common" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,11 +25,8 @@ const addon = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
browser: path.resolve('../../out/target-browser'),
|
||||
common: path.resolve('../../out/common'),
|
||||
browser: path.resolve('../../out/browser'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { Terminal, ITerminalAddon, IDisposable } from '@xterm/xterm';
|
||||
import type { ProgressAddon as IProgressApi, IProgressState } from '@xterm/addon-progress';
|
||||
import type { Emitter, IEvent } from 'common/Event';
|
||||
import type { Emitter, IEvent } from 'common/base/Event';
|
||||
|
||||
|
||||
const enum ProgressType {
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
],
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-progress": [
|
||||
"../typings/addon-progress.d.ts"
|
||||
@@ -33,10 +32,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,11 +25,8 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
browser: path.resolve('../../out/target-browser'),
|
||||
common: path.resolve('../../out/common'),
|
||||
browser: path.resolve('../../out/browser'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import type { Terminal, IDisposable, IDecoration } from '@xterm/xterm';
|
||||
import type { ISearchDecorationOptions } from '@xterm/addon-search';
|
||||
import { dispose, Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { dispose, Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import type { ISearchResult } from './SearchEngine';
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
import type { Terminal, IDisposable, ITerminalAddon } from '@xterm/xterm';
|
||||
import type { SearchAddon as ISearchApi, ISearchOptions, ISearchAddonOptions, ISearchResultChangeEvent, ISearchDecorationOptions } from '@xterm/addon-search';
|
||||
import { Emitter, type IEvent } from 'common/Event';
|
||||
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { disposableTimeout } from 'common/Async';
|
||||
import { Emitter, type IEvent } from 'common/base/Event';
|
||||
import { Disposable, MutableDisposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { disposableTimeout } from 'common/base/Async';
|
||||
import { SearchLineCache } from './SearchLineCache';
|
||||
import { SearchState } from './SearchState';
|
||||
import { SearchEngine, type ISearchResult } from './SearchEngine';
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
import { assert } from 'chai';
|
||||
import { SearchEngine } from './SearchEngine';
|
||||
import { SearchLineCache } from './SearchLineCache';
|
||||
import { Terminal } from 'target-browser/public/Terminal';
|
||||
import { Terminal } from 'browser/public/Terminal';
|
||||
import type { ISearchOptions } from '@xterm/addon-search';
|
||||
import { DisposableStore } from 'common/Lifecycle';
|
||||
import { DisposableStore } from 'common/base/Lifecycle';
|
||||
|
||||
function writeP(terminal: Terminal, data: string): Promise<void> {
|
||||
return new Promise(r => terminal.write(data, r));
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { assert } from 'chai';
|
||||
import { SearchLineCache, LineCacheEntry } from './SearchLineCache';
|
||||
import { Terminal } from 'target-browser/public/Terminal';
|
||||
import { timeout } from 'common/Async';
|
||||
import { Terminal } from 'browser/public/Terminal';
|
||||
import { timeout } from 'common/base/Async';
|
||||
|
||||
function writeP(terminal: Terminal, data: string): Promise<void> {
|
||||
return new Promise(r => terminal.write(data, r));
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import type { Terminal } from '@xterm/xterm';
|
||||
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { disposableTimeout } from 'common/Async';
|
||||
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { disposableTimeout } from 'common/base/Async';
|
||||
|
||||
export type LineCacheEntry = [
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
import type { ISearchResultChangeEvent } from '@xterm/addon-search';
|
||||
import type { IDisposable } from '@xterm/xterm';
|
||||
import { Emitter, type IEvent } from 'common/Event';
|
||||
import { Disposable } from 'common/Lifecycle';
|
||||
import { Emitter, type IEvent } from 'common/base/Event';
|
||||
import { Disposable } from 'common/base/Lifecycle';
|
||||
import type { ISearchResult } from './SearchEngine';
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
],
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-search" : [
|
||||
"../typings/addon-search.d.ts"
|
||||
@@ -33,10 +32,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
common: path.resolve('../../out/common'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
|
||||
|
||||
import { spawn } from 'node-pty';
|
||||
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
|
||||
import { Terminal } from 'target-browser/public/Terminal';
|
||||
import { Utf8ToUtf32, stringFromCodePoint } from 'common/base/TextDecoder';
|
||||
import { Terminal } from 'browser/public/Terminal';
|
||||
import { SerializeAddon } from 'SerializeAddon';
|
||||
|
||||
class TestTerminal extends Terminal {
|
||||
|
||||
@@ -12,11 +12,8 @@
|
||||
"target": "es2021",
|
||||
"module": "nodenext",
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
],
|
||||
"target-browser/*": ["../../../src/target-browser/*"],
|
||||
"common/*": ["../../../src/common/*"],
|
||||
"browser/*": ["../../../src/browser/*"],
|
||||
"SerializeAddon": ["../src/SerializeAddon"],
|
||||
"@xterm/addon-serialize": [
|
||||
"../typings/addon-serialize.d.ts"
|
||||
@@ -26,7 +23,7 @@
|
||||
"include": ["../**/*", "../../../typings/xterm.d.ts"],
|
||||
"exclude": ["../../../**/*test.ts", "../../**/*api.ts"],
|
||||
"references": [
|
||||
{ "path": "../../../src" },
|
||||
{ "path": "../../../src/target-browser" }
|
||||
{ "path": "../../../src/common" },
|
||||
{ "path": "../../../src/browser" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
import jsdom = require('jsdom');
|
||||
import { assert } from 'chai';
|
||||
import { SerializeAddon } from './SerializeAddon';
|
||||
import { Terminal } from 'target-browser/public/Terminal';
|
||||
import { SelectionModel } from 'target-browser/selection/SelectionModel';
|
||||
import { Terminal } from 'browser/public/Terminal';
|
||||
import { SelectionModel } from 'browser/selection/SelectionModel';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { ThemeService } from 'target-browser/services/ThemeService';
|
||||
import { ThemeService } from 'browser/services/ThemeService';
|
||||
|
||||
function sgr(...seq: string[]): string {
|
||||
return `\x1b[${seq.join(';')}m`;
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
|
||||
import type { IBuffer, IBufferCell, IBufferRange, ITerminalAddon, Terminal } from '@xterm/xterm';
|
||||
import type { IHTMLSerializeOptions, SerializeAddon as ISerializeApi, ISerializeOptions, ISerializeRange } from '@xterm/addon-serialize';
|
||||
import { IAttributeData, IColor } from 'common/Types';
|
||||
import { DEFAULT_ANSI_COLORS } from 'target-browser/Types';
|
||||
import type { IAttributeData } from 'common/buffer/CellTypes';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
import { DEFAULT_ANSI_COLORS } from 'browser/Types';
|
||||
import { UnderlineStyle } from 'common/buffer/Constants';
|
||||
|
||||
function constrain(value: number, low: number, high: number): number {
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-serialize": [
|
||||
"../typings/addon-serialize.d.ts"
|
||||
@@ -34,10 +33,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
]
|
||||
},
|
||||
"strict": true,
|
||||
@@ -29,10 +28,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,11 +25,8 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
browser: path.resolve('../../out/target-browser')
|
||||
common: path.resolve('../../out/common'),
|
||||
browser: path.resolve('../../out/browser')
|
||||
}
|
||||
},
|
||||
output: {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
|
||||
|
||||
import { spawn } from 'node-pty';
|
||||
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
|
||||
import { CoreBrowserTerminal } from 'target-browser/CoreBrowserTerminal';
|
||||
import { Utf8ToUtf32, stringFromCodePoint } from 'common/base/TextDecoder';
|
||||
import { CoreBrowserTerminal } from 'browser/CoreBrowserTerminal';
|
||||
import { UnicodeGraphemeProvider } from 'UnicodeGraphemeProvider';
|
||||
|
||||
|
||||
|
||||
@@ -9,11 +9,8 @@
|
||||
"target": "es2015",
|
||||
"module": "nodenext",
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
],
|
||||
"target-browser/*": ["../../../src/target-browser/*"],
|
||||
"common/*": ["../../../src/common/*"],
|
||||
"browser/*": ["../../../src/browser/*"],
|
||||
"UnicodeGraphemeProvider": ["../src/UnicodeGraphemeProvider"],
|
||||
"@xterm/addon-unicode-graphemes": [
|
||||
"../typings/addon-unicode-graphemes.d.ts"
|
||||
@@ -23,7 +20,7 @@
|
||||
"include": ["../**/*", "../../../typings/xterm.d.ts"],
|
||||
"exclude": ["../../../**/*test.ts", "../../**/*api.ts"],
|
||||
"references": [
|
||||
{ "path": "../../../src" },
|
||||
{ "path": "../../../src/target-browser" }
|
||||
{ "path": "../../../src/common" },
|
||||
{ "path": "../../../src/browser" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { IUnicodeVersionProvider } from '@xterm/xterm';
|
||||
import { createPropertyValue, extractCharKind, extractWidth } from 'common/input/UnicodeProperties';
|
||||
import { UnicodeCharProperties, UnicodeCharWidth } from 'common/input/UnicodeTypes';
|
||||
import { UnicodeCharProperties, UnicodeCharWidth } from 'common/services/Services';
|
||||
import { UnicodeService } from 'common/services/UnicodeService';
|
||||
import * as UC from './third-party/UnicodeProperties';
|
||||
|
||||
export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
@@ -19,7 +19,7 @@ export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
}
|
||||
|
||||
private static readonly _plainNarrowProperties: UnicodeCharProperties
|
||||
= createPropertyValue(UC.GRAPHEME_BREAK_Other, 1, false);
|
||||
= UnicodeService.createPropertyValue(UC.GRAPHEME_BREAK_Other, 1, false);
|
||||
|
||||
public charProperties(codepoint: number, preceding: UnicodeCharProperties): UnicodeCharProperties {
|
||||
// Optimize the simple ASCII case, under the condition that
|
||||
@@ -39,9 +39,9 @@ export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
w = 1;
|
||||
}
|
||||
if (preceding !== 0) {
|
||||
const oldWidth = extractWidth(preceding);
|
||||
const oldWidth = UnicodeService.extractWidth(preceding);
|
||||
if (this.handleGraphemes) {
|
||||
charInfo = UC.shouldJoin(extractCharKind(preceding), charInfo);
|
||||
charInfo = UC.shouldJoin(UnicodeService.extractCharKind(preceding), charInfo);
|
||||
} else {
|
||||
charInfo = w === 0 ? 1 : 0;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
return createPropertyValue(charInfo, w, shouldJoin);
|
||||
return UnicodeService.createPropertyValue(charInfo, w, shouldJoin);
|
||||
}
|
||||
|
||||
public wcwidth(codepoint: number): UnicodeCharWidth {
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"@xterm/addon-unicode-graphemes": [
|
||||
"../typings/addon-unicode-graphemes.d.ts"
|
||||
@@ -30,7 +29,7 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
]
|
||||
},
|
||||
"strict": true,
|
||||
@@ -29,10 +28,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
common: path.resolve('../../out/common'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { IUnicodeVersionProvider } from '@xterm/xterm';
|
||||
import { createPropertyValue, extractWidth } from 'common/input/UnicodeProperties';
|
||||
import { UnicodeCharProperties, UnicodeCharWidth } from 'common/input/UnicodeTypes';
|
||||
import { UnicodeCharProperties, UnicodeCharWidth } from 'common/services/Services';
|
||||
import { UnicodeService } from 'common/services/UnicodeService';
|
||||
|
||||
const BMP_COMBINING = [
|
||||
[0x0300, 0x036F], [0x0483, 0x0489], [0x0591, 0x05BD],
|
||||
@@ -223,13 +223,13 @@ export class UnicodeV11 implements IUnicodeVersionProvider {
|
||||
let width = this.wcwidth(codepoint);
|
||||
let shouldJoin = width === 0 && preceding !== 0;
|
||||
if (shouldJoin) {
|
||||
const oldWidth = extractWidth(preceding);
|
||||
const oldWidth = UnicodeService.extractWidth(preceding);
|
||||
if (oldWidth === 0) {
|
||||
shouldJoin = false;
|
||||
} else if (oldWidth > width) {
|
||||
width = oldWidth;
|
||||
}
|
||||
}
|
||||
return createPropertyValue(0, width, shouldJoin);
|
||||
return UnicodeService.createPropertyValue(0, width, shouldJoin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"@xterm/addon-unicode11": [
|
||||
"../typings/addon-unicode11.d.ts"
|
||||
@@ -33,7 +32,7 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
common: path.resolve('../../out/common'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -32,10 +31,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { ISelectionRenderModel } from 'target-browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'target-browser/services/Services';
|
||||
import { ReadonlyColorSet } from 'target-browser/Types';
|
||||
import { ISelectionRenderModel } from 'browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'browser/services/Services';
|
||||
import { ReadonlyColorSet } from 'browser/Types';
|
||||
import { Attributes, BgFlags, ExtFlags, FgFlags, NULL_CELL_CODE, UnderlineStyle } from 'common/buffer/Constants';
|
||||
import { IDecorationService, IOptionsService } from 'common/services/Services';
|
||||
import { ICellData } from 'common/Types';
|
||||
import type { ICellData } from 'common/buffer/CellTypes';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { rgba } from 'common/Color';
|
||||
import { treatGlyphAsBackgroundColor } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { rgba } from 'common/base/Color';
|
||||
import { treatGlyphAsBackgroundColor } from 'browser/renderer/shared/RendererUtils';
|
||||
import { blockPatternCodepoints } from './customGlyphs/CustomGlyphDefinitions';
|
||||
|
||||
// Work variables to avoid garbage collection
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { TextureAtlas } from './TextureAtlas';
|
||||
import { ITerminalOptions, Terminal } from '@xterm/xterm';
|
||||
import { ITerminal, ReadonlyColorSet } from 'target-browser/Types';
|
||||
import { ITerminal, ReadonlyColorSet } from 'browser/Types';
|
||||
import { ICharAtlasConfig, ITextureAtlas } from './Types';
|
||||
import { generateConfig, configEquals } from './CharAtlasUtils';
|
||||
import type { ILogService } from 'common/services/Services';
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { assert } from 'chai';
|
||||
import { configEquals } from './CharAtlasUtils';
|
||||
import { ICharAtlasConfig } from './Types';
|
||||
import { NULL_COLOR } from 'common/Color';
|
||||
import { IColor } from 'common/Types';
|
||||
import { NULL_COLOR } from 'common/base/Color';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
|
||||
function createTestConfig(overrides: Partial<ICharAtlasConfig> = {}): ICharAtlasConfig {
|
||||
const color: IColor = { css: '#ffffff', rgba: 0xffffffff };
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { ICharAtlasConfig } from './Types';
|
||||
import { Attributes } from 'common/buffer/Constants';
|
||||
import { ITerminalOptions } from '@xterm/xterm';
|
||||
import { IColorSet, ReadonlyColorSet } from 'target-browser/Types';
|
||||
import { NULL_COLOR } from 'common/Color';
|
||||
import { IColorSet, ReadonlyColorSet } from 'browser/Types';
|
||||
import { NULL_COLOR } from 'common/base/Color';
|
||||
|
||||
export function generateConfig(deviceCellWidth: number, deviceCellHeight: number, deviceCharWidth: number, deviceCharHeight: number, options: Required<ITerminalOptions>, colors: ReadonlyColorSet, devicePixelRatio: number, deviceMaxTextureSize: number, customGlyphs: boolean = true): ICharAtlasConfig {
|
||||
// null out some fields that don't matter
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { isFirefox, isLegacyEdge } from 'common/Platform';
|
||||
import { isFirefox, isLegacyEdge } from 'common/base/Platform';
|
||||
|
||||
export const DIM_OPACITY = 0.5;
|
||||
// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { RendererConstants } from 'target-browser/renderer/shared/Constants';
|
||||
import { ICoreBrowserService } from 'target-browser/services/Services';
|
||||
import { RendererConstants } from 'browser/renderer/shared/Constants';
|
||||
import { ICoreBrowserService } from 'browser/services/Services';
|
||||
|
||||
const enum Constants {
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { toDisposable, IDisposable } from 'common/Lifecycle';
|
||||
import { toDisposable, IDisposable } from 'common/base/Lifecycle';
|
||||
|
||||
export function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {
|
||||
// Observe any resizes to the element and extract the actual pixel size of the element if the
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
* @license MIT
|
||||
*/
|
||||
import { TextureAtlas } from './TextureAtlas';
|
||||
import { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
import { NULL_CELL_CODE } from 'common/buffer/Constants';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { IRenderModel, IWebGL2RenderingContext, IWebGLVertexArrayObject, type IRasterizedGlyph, type ITextureAtlas } from './Types';
|
||||
import { createProgram, GLTexture, PROJECTION_MATRIX } from './WebglUtils';
|
||||
import type { ILogService, IOptionsService } from 'common/services/Services';
|
||||
import { allowRescaling, throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { allowRescaling, throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
|
||||
interface IVertices {
|
||||
attributes: Float32Array;
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import { IThemeService } from 'target-browser/services/Services';
|
||||
import { ReadonlyColorSet } from 'target-browser/Types';
|
||||
import { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
import { IThemeService } from 'browser/services/Services';
|
||||
import { ReadonlyColorSet } from 'browser/Types';
|
||||
import { Attributes, FgFlags } from 'common/buffer/Constants';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { IColor } from 'common/Types';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { RenderModelConstants } from './RenderModel';
|
||||
import { IRenderModel, IWebGL2RenderingContext, IWebGLVertexArrayObject } from './Types';
|
||||
import { createProgram, expandFloat32Array, PROJECTION_MATRIX } from './WebglUtils';
|
||||
import { throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
import type { ILogService } from 'common/services/Services';
|
||||
|
||||
const enum VertexAttribLocations {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import { ICursorRenderModel, IRenderModel } from './Types';
|
||||
import { ISelectionRenderModel } from 'target-browser/renderer/shared/Types';
|
||||
import { createSelectionRenderModel } from 'target-browser/renderer/shared/SelectionRenderModel';
|
||||
import { ISelectionRenderModel } from 'browser/renderer/shared/Types';
|
||||
import { createSelectionRenderModel } from 'browser/renderer/shared/SelectionRenderModel';
|
||||
|
||||
export const enum RenderModelConstants {
|
||||
INDICIES_PER_CELL = 4,
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IColorContrastCache } from 'target-browser/Types';
|
||||
import { IColorContrastCache } from 'browser/Types';
|
||||
import { DIM_OPACITY, TEXT_BASELINE } from './Constants';
|
||||
import { tryDrawCustomGlyph } from './customGlyphs/CustomGlyphRasterizer';
|
||||
import { computeNextVariantOffset, treatGlyphAsBackgroundColor, isPowerlineGlyph, isRestrictedPowerlineGlyph, throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { computeNextVariantOffset, treatGlyphAsBackgroundColor, isPowerlineGlyph, isRestrictedPowerlineGlyph, throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
import { IBoundingBox, ICharAtlasConfig, IRasterizedGlyph, ITextureAtlas } from './Types';
|
||||
import { NULL_COLOR, channels, color, rgba } from 'common/Color';
|
||||
import { FourKeyMap } from 'common/MultiKeyMap';
|
||||
import { IdleTaskQueue } from 'common/TaskQueue';
|
||||
import { IColor } from 'common/Types';
|
||||
import { NULL_COLOR, channels, color, rgba } from 'common/base/Color';
|
||||
import { FourKeyMap } from 'common/base/MultiKeyMap';
|
||||
import { IdleTaskQueue } from 'common/base/TaskQueue';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
import { Attributes, DEFAULT_COLOR, DEFAULT_EXT, UnderlineStyle } from 'common/buffer/Constants';
|
||||
import { ILogService, IUnicodeService } from 'common/services/Services';
|
||||
import { Emitter } from 'common/Event';
|
||||
import { Emitter } from 'common/base/Event';
|
||||
|
||||
/**
|
||||
* A shared object which is used to draw nothing for a particular cell.
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
*/
|
||||
|
||||
import { FontWeight } from '@xterm/xterm';
|
||||
import { IColorSet } from 'target-browser/Types';
|
||||
import { ISelectionRenderModel } from 'target-browser/renderer/shared/Types';
|
||||
import { CursorInactiveStyle, CursorStyle, type IDisposable } from 'common/Types';
|
||||
import type { IEvent } from 'common/Event';
|
||||
import { IColorSet } from 'browser/Types';
|
||||
import { ISelectionRenderModel } from 'browser/renderer/shared/Types';
|
||||
import type { IDisposable } from 'common/base/Lifecycle';
|
||||
import { CursorInactiveStyle, CursorStyle } from 'common/services/Types';
|
||||
import type { IEvent } from 'common/base/Event';
|
||||
|
||||
export interface IRenderModel {
|
||||
cells: Uint32Array;
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
import type { ITerminalAddon, Terminal } from '@xterm/xterm';
|
||||
import type { IWebglAddonOptions, WebglAddon as IWebglApi } from '@xterm/addon-webgl';
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from 'target-browser/services/Services';
|
||||
import { ITerminal } from 'target-browser/Types';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { getSafariVersion, isSafari } from 'common/Platform';
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
||||
import { ITerminal } from 'browser/Types';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { getSafariVersion, isSafari } from 'common/base/Platform';
|
||||
import { ICoreService, IDecorationService, ILogService, IOptionsService } from 'common/services/Services';
|
||||
import { IWebGL2RenderingContext } from './Types';
|
||||
import { WebglRenderer } from './WebglRenderer';
|
||||
import { Emitter, EventUtils } from 'common/Event';
|
||||
import { Emitter, EventUtils } from 'common/base/Event';
|
||||
|
||||
export class WebglAddon extends Disposable implements ITerminalAddon, IWebglApi {
|
||||
private _terminal?: Terminal;
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { ITerminal } from 'target-browser/Types';
|
||||
import { ITerminal } from 'browser/Types';
|
||||
import { CellColorResolver } from './CellColorResolver';
|
||||
import { acquireTextureAtlas, removeTerminalFromCache } from './CharAtlasCache';
|
||||
import { CursorBlinkStateManager } from './CursorBlinkStateManager';
|
||||
import { observeDevicePixelDimensions } from './DevicePixelObserver';
|
||||
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'target-browser/renderer/shared/Types';
|
||||
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IThemeService } from 'target-browser/services/Services';
|
||||
import { CharData, IBufferLine, ICellData } from 'common/Types';
|
||||
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/shared/Types';
|
||||
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IThemeService } from 'browser/services/Services';
|
||||
import type { CharData, IBufferLine, ICellData } from 'common/buffer/CellTypes';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { Attributes, Content, FgFlags, NULL_CELL_CHAR, NULL_CELL_CODE } from 'common/buffer/Constants';
|
||||
import { TextBlinkStateManager } from 'target-browser/renderer/shared/TextBlinkStateManager';
|
||||
import { TextBlinkStateManager } from 'browser/renderer/shared/TextBlinkStateManager';
|
||||
import { ICoreService, IDecorationService, ILogService, IOptionsService } from 'common/services/Services';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { GlyphRenderer } from './GlyphRenderer';
|
||||
@@ -23,10 +23,10 @@ import { COMBINED_CHAR_BIT_MASK, RenderModel, RenderModelConstants } from './Ren
|
||||
import { IWebGL2RenderingContext, type ITextureAtlas } from './Types';
|
||||
import { LinkRenderLayer } from './renderLayer/LinkRenderLayer';
|
||||
import { IRenderLayer } from './renderLayer/Types';
|
||||
import { Emitter, EventUtils } from 'common/Event';
|
||||
import { addDisposableListener } from 'target-browser/Dom';
|
||||
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { createRenderDimensions } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { Emitter, EventUtils } from 'common/base/Event';
|
||||
import { addDisposableListener } from 'browser/Dom';
|
||||
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';
|
||||
|
||||
const enum Constants {
|
||||
MERGE_RETRY_LIMIT = 32
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
import type { ILogService } from 'common/services/Services';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
import type { ILogService } from 'common/services/Services';
|
||||
import { customGlyphDefinitions } from './CustomGlyphDefinitions';
|
||||
import { CustomGlyphDefinitionType, CustomGlyphScaleType, CustomGlyphVectorType, type CustomGlyphDefinitionPart, type CustomGlyphPathDrawFunctionDefinition, type CustomGlyphPatternDefinition, type ICustomGlyphSolidOctantBlockVector, type ICustomGlyphVectorShape } from './Types';
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { ReadonlyColorSet } from 'target-browser/Types';
|
||||
import { ReadonlyColorSet } from 'browser/Types';
|
||||
import { acquireTextureAtlas } from '../CharAtlasCache';
|
||||
import { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'target-browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { IOptionsService } from 'common/services/Services';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { IRenderLayer } from './Types';
|
||||
import { throwIfFalsy } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';
|
||||
import { TEXT_BASELINE } from '../Constants';
|
||||
import type { ITextureAtlas } from '../Types';
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
|
||||
import { is256Color } from '../CharAtlasUtils';
|
||||
import { INVERTED_DEFAULT_COLOR } from 'target-browser/renderer/shared/Constants';
|
||||
import { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'target-browser/services/Services';
|
||||
import { ILinkifier2, ILinkifierEvent } from 'target-browser/Types';
|
||||
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants';
|
||||
import { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
import { ICoreBrowserService, IThemeService } from 'browser/services/Services';
|
||||
import { ILinkifier2, ILinkifierEvent } from 'browser/Types';
|
||||
import { IOptionsService } from 'common/services/Services';
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { BaseRenderLayer } from './BaseRenderLayer';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { IDisposable, Terminal } from '@xterm/xterm';
|
||||
import { IRenderDimensions } from 'target-browser/renderer/shared/Types';
|
||||
import { IRenderDimensions } from 'browser/renderer/shared/Types';
|
||||
|
||||
export interface IRenderLayer extends IDisposable {
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"@xterm/addon-webgl": [
|
||||
"../typings/addon-webgl.d.ts"
|
||||
@@ -37,10 +36,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
"removeComments": true,
|
||||
"paths": {
|
||||
"common/*": [
|
||||
"../../../src/primitives/*",
|
||||
"../../../src/runtime/*",
|
||||
"../../../src/common/*"
|
||||
],
|
||||
"target-browser/*": [
|
||||
"../../../src/target-browser/*"
|
||||
"browser/*": [
|
||||
"../../../src/browser/*"
|
||||
],
|
||||
"*": [
|
||||
"./*"
|
||||
@@ -33,10 +32,10 @@
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../src"
|
||||
"path": "../../../src/common"
|
||||
},
|
||||
{
|
||||
"path": "../../../src/target-browser"
|
||||
"path": "../../../src/browser"
|
||||
},
|
||||
{
|
||||
"path": "../../../test/playwright"
|
||||
|
||||
@@ -25,11 +25,8 @@ module.exports = {
|
||||
modules: ['./node_modules'],
|
||||
extensions: [ '.js' ],
|
||||
alias: {
|
||||
common: [
|
||||
path.resolve('../../out/runtime'),
|
||||
path.resolve('../../out/primitives'),
|
||||
],
|
||||
browser: path.resolve('../../out/target-browser'),
|
||||
common: path.resolve('../../out/common'),
|
||||
browser: path.resolve('../../out/browser'),
|
||||
vs: path.resolve('../../out/vs')
|
||||
}
|
||||
},
|
||||
|
||||
+13
-37
@@ -92,9 +92,6 @@ let outConfig = {
|
||||
}
|
||||
let skipOut = false;
|
||||
|
||||
/** @type {esbuild.BuildOptions[] | undefined} */
|
||||
let outBuilds;
|
||||
|
||||
/** @type {esbuild.BuildOptions} */
|
||||
let outTestConfig = {
|
||||
format: 'cjs',
|
||||
@@ -174,7 +171,7 @@ if (config.addon) {
|
||||
} else if (config.isHeadless) {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`src/target-headless/public/Terminal.ts`],
|
||||
entryPoints: [`src/headless/public/Terminal.ts`],
|
||||
outfile: `headless/lib-headless/xterm-headless.mjs`
|
||||
};
|
||||
outConfig = {
|
||||
@@ -186,35 +183,18 @@ if (config.addon) {
|
||||
} else {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`src/target-browser/public/Terminal.ts`],
|
||||
entryPoints: [`src/browser/public/Terminal.ts`],
|
||||
outfile: `lib/xterm.mjs`
|
||||
};
|
||||
outBuilds = [
|
||||
{
|
||||
...outConfig,
|
||||
entryPoints: ['src/primitives/**/*.ts'],
|
||||
outbase: 'src/primitives',
|
||||
outdir: 'out-esbuild/common',
|
||||
},
|
||||
{
|
||||
...outConfig,
|
||||
entryPoints: ['src/runtime/**/*.ts'],
|
||||
outbase: 'src/runtime',
|
||||
outdir: 'out-esbuild/common',
|
||||
},
|
||||
{
|
||||
...outConfig,
|
||||
entryPoints: ['src/target-browser/**/*.ts'],
|
||||
outbase: 'src',
|
||||
outdir: 'out-esbuild',
|
||||
},
|
||||
{
|
||||
...outConfig,
|
||||
entryPoints: ['src/target-headless/**/*.ts'],
|
||||
outbase: 'src',
|
||||
outdir: 'out-esbuild',
|
||||
},
|
||||
];
|
||||
outConfig = {
|
||||
...outConfig,
|
||||
entryPoints: [
|
||||
'src/browser/**/*.ts',
|
||||
'src/common/**/*.ts',
|
||||
'src/headless/**/*.ts'
|
||||
],
|
||||
outdir: 'out-esbuild/'
|
||||
};
|
||||
outTestConfig = {
|
||||
...outConfig,
|
||||
entryPoints: ['test/**/*.ts'],
|
||||
@@ -225,9 +205,7 @@ if (config.addon) {
|
||||
if (config.isWatch) {
|
||||
context(bundleConfig).then(e => e.watch());
|
||||
if (!skipOut) {
|
||||
for (const buildConfig of outBuilds ?? [outConfig]) {
|
||||
context(buildConfig).then(e => e.watch());
|
||||
}
|
||||
context(outConfig).then(e => e.watch());
|
||||
}
|
||||
if (!skipOutTest) {
|
||||
context(outTestConfig).then(e => e.watch());
|
||||
@@ -235,9 +213,7 @@ if (config.isWatch) {
|
||||
} else {
|
||||
await build(bundleConfig);
|
||||
if (!skipOut) {
|
||||
for (const buildConfig of outBuilds ?? [outConfig]) {
|
||||
await build(buildConfig);
|
||||
}
|
||||
await build(outConfig);
|
||||
}
|
||||
if (!skipOutTest) {
|
||||
await build(outTestConfig);
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ function checkAndPublishPackage(packageDir, repoCommit, peerDependencies, update
|
||||
|
||||
// Update Version.ts with the new version
|
||||
if (updateVersionTs) {
|
||||
const versionTsPath = path.join(packageDir, 'src/primitives/Version.ts');
|
||||
const versionTsPath = path.join(packageDir, 'src/common/base/Version.ts');
|
||||
const versionTsContent = fs.readFileSync(versionTsPath, 'utf8');
|
||||
const updatedVersionTs = versionTsContent.replace(
|
||||
/export const XTERM_VERSION = '[^']+';/,
|
||||
|
||||
@@ -38,4 +38,4 @@ function findUnusedSymbols(
|
||||
}
|
||||
|
||||
// Example usage
|
||||
findUnusedSymbols("./src/target-browser/tsconfig.json");
|
||||
findUnusedSymbols("./src/browser/tsconfig.json");
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# xterm.js source architecture
|
||||
|
||||
This document describes how `src/` is organized. The layout follows [issue #5963](https://github.com/xtermjs/xterm.js/issues/5963): **primitives** and **runtime** as separate TypeScript composite projects, with **target-browser** and **target-headless** as platform entry points.
|
||||
|
||||
## Dependency graph
|
||||
|
||||
```mermaid
|
||||
flowchart BT
|
||||
primitives["primitives<br/>building blocks"]
|
||||
runtime["runtime<br/>services, integration"]
|
||||
targetBrowser["target-browser<br/>DOM terminal"]
|
||||
targetHeadless["target-headless<br/>Node terminal"]
|
||||
|
||||
runtime --> primitives
|
||||
targetBrowser --> runtime
|
||||
targetHeadless --> runtime
|
||||
```
|
||||
|
||||
## TypeScript projects
|
||||
|
||||
| Project | `tsconfig` | Output | Role |
|
||||
| --- | --- | --- | --- |
|
||||
| Primitives | `src/primitives/tsconfig.json` | `out/primitives/` | Buffer, parser, input helpers, static data, shared utilities. Must not import from `runtime/`. |
|
||||
| Runtime | `src/runtime/tsconfig.json` | `out/runtime/` | Services (DI), `CoreTerminal`, `InputHandler`, public API adapters, `Types.ts`. References primitives. |
|
||||
| Source (solution) | `src/tsconfig.json` | — | Solution root; references primitives + runtime only. |
|
||||
| Target browser | `src/target-browser/tsconfig.json` | `out/target-browser/` | Browser rendering, input, public `Terminal`. References `src/`. |
|
||||
| Target headless | `src/target-headless/tsconfig.json` | `out/target-headless/` | Headless terminal. References `src/`. |
|
||||
|
||||
Unit test files (`**/*.test.ts`) are excluded from composite library builds; they are compiled via esbuild for `npm run test-unit`.
|
||||
|
||||
## `primitives/`
|
||||
|
||||
| Area | Contents |
|
||||
| --- | --- |
|
||||
| Root utilities | `Async`, `CircularList`, `Color`, `ColorTypes`, `Event`, `KeyboardTypes`, `Lifecycle`, `MultiKeyMap`, `Platform`, `SortedList`, `StringBuilder`, `TaskQueue`, `TerminalOptions`, `Version` |
|
||||
| `buffer/` | Screen buffer, `CellTypes`, `BufferService` / `BufferOptions` / `BufferLog` interfaces (buffer-layer contracts) |
|
||||
| `data/` | `Charsets`, `EscapeSequences` |
|
||||
| `input/` | UTF decoding, keyboard helpers, `UnicodeTypes`, `UnicodeProperties` |
|
||||
| `parser/` | Escape-sequence parser |
|
||||
|
||||
Primitives depend only on other primitives (and `@xterm/xterm` typings where needed). Buffer code uses `IBufferService` from `common/buffer/BufferService`, not `common/services/Services`.
|
||||
|
||||
## `runtime/`
|
||||
|
||||
| Area | Contents |
|
||||
| --- | --- |
|
||||
| `services/` | DI implementations (`BufferService`, `OptionsService`, …) |
|
||||
| `public/` | Public API adapters (`AddonManager`, buffer/parser views) |
|
||||
| Root | `CoreTerminal`, `InputHandler`, `WindowsMode`, `Types.ts`, `TestUtils.test.ts` |
|
||||
|
||||
`Types.ts` re-exports primitive types and adds integration types (`IInputHandler`, `ICoreTerminal`, mouse/color helpers, etc.).
|
||||
|
||||
## Import paths
|
||||
|
||||
Source keeps the `common/...` prefix (logical module name, not a physical `common/` folder). Each project's `paths` in `tsconfig.json` map that prefix to `primitives/` and/or `runtime/`.
|
||||
|
||||
Platform code uses:
|
||||
|
||||
- `target-browser/...` — browser terminal
|
||||
- `target-headless/...` — Node terminal
|
||||
|
||||
## Published packages vs source folders
|
||||
|
||||
The npm package directory `headless/` (e.g. `headless/lib-headless/`) is unchanged; only the **source** tree uses `src/target-headless/`.
|
||||
|
||||
## Related issues
|
||||
|
||||
- [#5963](https://github.com/xtermjs/xterm.js/issues/5963) — module split
|
||||
- [#5896](https://github.com/xtermjs/xterm.js/issues/5896) — relative imports
|
||||
- [#5897](https://github.com/xtermjs/xterm.js/issues/5897) — `import/no-cycle` lint
|
||||
@@ -3,14 +3,14 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import * as Strings from 'target-browser/LocalizableStrings';
|
||||
import { ITerminal, IRenderDebouncer } from 'target-browser/Types';
|
||||
import { TimeBasedDebouncer } from 'target-browser/TimeBasedDebouncer';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { ICoreBrowserService, IRenderService } from 'target-browser/services/Services';
|
||||
import * as Strings from 'browser/LocalizableStrings';
|
||||
import { ITerminal, IRenderDebouncer } from 'browser/Types';
|
||||
import { TimeBasedDebouncer } from 'browser/TimeBasedDebouncer';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { ICoreBrowserService, IRenderService } from 'browser/services/Services';
|
||||
import { IBuffer } from 'common/buffer/Types';
|
||||
import { IInstantiationService } from 'common/services/Services';
|
||||
import { addDisposableListener } from 'target-browser/Dom';
|
||||
import { addDisposableListener } from 'browser/Dom';
|
||||
|
||||
const enum Constants {
|
||||
MAX_ROWS_TO_READ = 20
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import * as Clipboard from 'target-browser/Clipboard';
|
||||
import * as Clipboard from 'browser/Clipboard';
|
||||
|
||||
describe('evaluatePastedTextProcessing', () => {
|
||||
it('should replace carriage return and/or line feed with carriage return', () => {
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { ISelectionService } from 'target-browser/services/Services';
|
||||
import { ISelectionService } from 'browser/services/Services';
|
||||
import { ICoreService, IOptionsService } from 'common/services/Services';
|
||||
|
||||
/**
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { ColorContrastCache } from 'target-browser/ColorContrastCache';
|
||||
import { ColorContrastCache } from 'browser/ColorContrastCache';
|
||||
|
||||
describe('ColorContrastCache', () => {
|
||||
let cache: ColorContrastCache;
|
||||
@@ -3,9 +3,9 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IColorContrastCache } from 'target-browser/Types';
|
||||
import { IColor } from 'common/Types';
|
||||
import { TwoKeyMap } from 'common/MultiKeyMap';
|
||||
import { IColorContrastCache } from 'browser/Types';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
import { TwoKeyMap } from 'common/base/MultiKeyMap';
|
||||
|
||||
export class ColorContrastCache implements IColorContrastCache {
|
||||
private _color: TwoKeyMap</* bg */number, /* fg */number, IColor | null> = new TwoKeyMap();
|
||||
@@ -22,43 +22,45 @@
|
||||
*/
|
||||
|
||||
import { IDecoration, IDecorationOptions, IDisposable, ILinkProvider, IMarker, IRenderDimensions as IRenderDimensionsApi } from '@xterm/xterm';
|
||||
import { copyHandler, handlePasteEvent, moveTextAreaUnderMouseCursor, paste, rightClickHandler } from 'target-browser/Clipboard';
|
||||
import * as Strings from 'target-browser/LocalizableStrings';
|
||||
import { OscLinkProvider } from 'target-browser/OscLinkProvider';
|
||||
import { CharacterJoinerHandler, CustomKeyEventHandler, CustomWheelEventHandler, IBrowser, IBufferRange, ICompositionHelper, ILinkifier2, ITerminal } from 'target-browser/Types';
|
||||
import { Viewport } from 'target-browser/Viewport';
|
||||
import { BufferDecorationRenderer } from 'target-browser/decorations/BufferDecorationRenderer';
|
||||
import { OverviewRulerRenderer } from 'target-browser/decorations/OverviewRulerRenderer';
|
||||
import { CompositionHelper } from 'target-browser/input/CompositionHelper';
|
||||
import { DomRenderer } from 'target-browser/renderer/dom/DomRenderer';
|
||||
import { IRenderer } from 'target-browser/renderer/shared/Types';
|
||||
import { CharSizeService } from 'target-browser/services/CharSizeService';
|
||||
import { CharacterJoinerService } from 'target-browser/services/CharacterJoinerService';
|
||||
import { CoreBrowserService } from 'target-browser/services/CoreBrowserService';
|
||||
import { LinkProviderService } from 'target-browser/services/LinkProviderService';
|
||||
import { MouseCoordsService } from 'target-browser/services/MouseCoordsService';
|
||||
import { MouseEventCssClasses, MouseService } from 'target-browser/services/MouseService';
|
||||
import { RenderService } from 'target-browser/services/RenderService';
|
||||
import { SelectionService } from 'target-browser/services/SelectionService';
|
||||
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IKeyboardService, ILinkProviderService, IMouseCoordsService, IMouseService, IRenderService, ISelectionService, IThemeService } from 'target-browser/services/Services';
|
||||
import { ThemeService } from 'target-browser/services/ThemeService';
|
||||
import { KeyboardService } from 'target-browser/services/KeyboardService';
|
||||
import { channels, color, rgb } from 'common/Color';
|
||||
import { CoreTerminal } from 'common/CoreTerminal';
|
||||
import * as Browser from 'common/Platform';
|
||||
import { ColorRequestType, IColorEvent, ITerminalOptions, KeyboardResultType, SpecialColorIndex } from 'common/Types';
|
||||
import { copyHandler, handlePasteEvent, moveTextAreaUnderMouseCursor, paste, rightClickHandler } from 'browser/Clipboard';
|
||||
import * as Strings from 'browser/LocalizableStrings';
|
||||
import { OscLinkProvider } from 'browser/OscLinkProvider';
|
||||
import { CharacterJoinerHandler, CustomKeyEventHandler, CustomWheelEventHandler, IBrowser, IBufferRange, ICompositionHelper, ILinkifier2, ITerminal } from 'browser/Types';
|
||||
import { Viewport } from 'browser/Viewport';
|
||||
import { BufferDecorationRenderer } from 'browser/decorations/BufferDecorationRenderer';
|
||||
import { OverviewRulerRenderer } from 'browser/decorations/OverviewRulerRenderer';
|
||||
import { CompositionHelper } from 'browser/input/CompositionHelper';
|
||||
import { DomRenderer } from 'browser/renderer/dom/DomRenderer';
|
||||
import { IRenderer } from 'browser/renderer/shared/Types';
|
||||
import { CharSizeService } from 'browser/services/CharSizeService';
|
||||
import { CharacterJoinerService } from 'browser/services/CharacterJoinerService';
|
||||
import { CoreBrowserService } from 'browser/services/CoreBrowserService';
|
||||
import { LinkProviderService } from 'browser/services/LinkProviderService';
|
||||
import { MouseCoordsService } from 'browser/services/MouseCoordsService';
|
||||
import { MouseEventCssClasses, MouseService } from 'browser/services/MouseService';
|
||||
import { RenderService } from 'browser/services/RenderService';
|
||||
import { SelectionService } from 'browser/services/SelectionService';
|
||||
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IKeyboardService, ILinkProviderService, IMouseCoordsService, IMouseService, IRenderService, ISelectionService, IThemeService } from 'browser/services/Services';
|
||||
import { ThemeService } from 'browser/services/ThemeService';
|
||||
import { KeyboardService } from 'browser/services/KeyboardService';
|
||||
import { channels, color, rgb } from 'common/base/Color';
|
||||
import { CoreTerminal } from 'common/terminal/CoreTerminal';
|
||||
import * as Browser from 'common/base/Platform';
|
||||
import type { ITerminalOptions } from 'common/services/Services';
|
||||
import { ColorRequestType, IColorEvent, SpecialColorIndex } from 'common/terminal/InputHandlerTypes';
|
||||
import { KeyboardResultType } from 'common/input/KeyboardTypes';
|
||||
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||
import { IBuffer } from 'common/buffer/Types';
|
||||
import { C0, C1ESCAPED } from 'common/data/EscapeSequences';
|
||||
import { C0, C1ESCAPED } from 'common/base/EscapeSequences';
|
||||
import { toRgbString } from 'common/input/XParseColor';
|
||||
import { DecorationService } from 'common/services/DecorationService';
|
||||
import { IDecorationService } from 'common/services/Services';
|
||||
import { WindowsOptionsReportType } from 'common/InputHandler';
|
||||
import { WindowsOptionsReportType } from '../common/terminal/InputHandler';
|
||||
import { AccessibilityManager } from './AccessibilityManager';
|
||||
import { Linkifier } from './Linkifier';
|
||||
import { Emitter, EventUtils, type IEvent } from 'common/Event';
|
||||
import { addDisposableListener } from 'target-browser/Dom';
|
||||
import { MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { Emitter, EventUtils, type IEvent } from 'common/base/Event';
|
||||
import { addDisposableListener } from 'browser/Dom';
|
||||
import { MutableDisposable, toDisposable } from 'common/base/Lifecycle';
|
||||
|
||||
export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
|
||||
public textarea: HTMLTextAreaElement | undefined;
|
||||
@@ -5,8 +5,8 @@
|
||||
* Minimal DOM helpers for xterm.js browser code.
|
||||
*/
|
||||
|
||||
import { IntervalTimer } from 'common/Async';
|
||||
import { IDisposable } from 'common/Lifecycle';
|
||||
import { IntervalTimer } from 'common/base/Async';
|
||||
import { IDisposable } from 'common/base/Lifecycle';
|
||||
|
||||
export function getWindow(e: Node | UIEvent | undefined | null): Window {
|
||||
const candidateNode = e as Node | undefined | null;
|
||||
@@ -6,9 +6,9 @@
|
||||
import { assert } from 'chai';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { Linkifier } from './Linkifier';
|
||||
import { MockBufferService } from 'common/TestUtils.test';
|
||||
import { ILink } from 'target-browser/Types';
|
||||
import { LinkProviderService } from 'target-browser/services/LinkProviderService';
|
||||
import { MockBufferService } from 'common/terminal/TestUtils.test';
|
||||
import { ILink } from 'browser/Types';
|
||||
import { LinkProviderService } from 'browser/services/LinkProviderService';
|
||||
import jsdom = require('jsdom');
|
||||
|
||||
class TestLinkifier2 extends Linkifier {
|
||||
@@ -3,13 +3,13 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IBufferCellPosition, ILink, ILinkDecorations, ILinkWithState, ILinkifier2, ILinkifierEvent } from 'target-browser/Types';
|
||||
import { Disposable, dispose, toDisposable } from 'common/Lifecycle';
|
||||
import { IDisposable } from 'common/Types';
|
||||
import { IBufferCellPosition, ILink, ILinkDecorations, ILinkWithState, ILinkifier2, ILinkifierEvent } from 'browser/Types';
|
||||
import { Disposable, dispose, toDisposable } from 'common/base/Lifecycle';
|
||||
import type { IDisposable } from 'common/base/Lifecycle';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { ILinkProviderService, IMouseCoordsService, IRenderService } from './services/Services';
|
||||
import { Emitter } from 'common/Event';
|
||||
import { addDisposableListener } from 'target-browser/Dom';
|
||||
import { Emitter } from 'common/base/Event';
|
||||
import { addDisposableListener } from 'browser/Dom';
|
||||
|
||||
export class Linkifier extends Disposable implements ILinkifier2 {
|
||||
public get currentLink(): ILinkWithState | undefined { return this._currentLink; }
|
||||
@@ -4,11 +4,12 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { OscLinkProvider } from 'target-browser/OscLinkProvider';
|
||||
import { ILink } from 'target-browser/Types';
|
||||
import { createCellData, MockBufferService, MockOptionsService } from 'common/TestUtils.test';
|
||||
import { OscLinkProvider } from 'browser/OscLinkProvider';
|
||||
import { ILink } from 'browser/Types';
|
||||
import { createCellData, MockBufferService, MockOptionsService } from 'common/terminal/TestUtils.test';
|
||||
import { IBufferService, IOscLinkService } from 'common/services/Services';
|
||||
import { IBufferLine, IOscLinkData } from 'common/Types';
|
||||
import type { IBufferLine } from 'common/buffer/CellTypes';
|
||||
import { IOscLinkData } from 'common/services/Types';
|
||||
|
||||
class TestOscLinkService implements IOscLinkService {
|
||||
public serviceBrand: any;
|
||||
@@ -3,10 +3,10 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IBufferRange, ILink } from 'target-browser/Types';
|
||||
import { ILinkProvider } from 'target-browser/services/Services';
|
||||
import { IBufferRange, ILink } from 'browser/Types';
|
||||
import { ILinkProvider } from 'browser/services/Services';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { IBufferLine } from 'common/Types';
|
||||
import type { IBufferLine } from 'common/buffer/CellTypes';
|
||||
import { IBufferService, IOptionsService, IOscLinkService } from 'common/services/Services';
|
||||
|
||||
export class OscLinkProvider implements ILinkProvider {
|
||||
@@ -3,8 +3,8 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IRenderDebouncerWithCallback } from 'target-browser/Types';
|
||||
import { ICoreBrowserService } from 'target-browser/services/Services';
|
||||
import { IRenderDebouncerWithCallback } from 'browser/Types';
|
||||
import { ICoreBrowserService } from 'browser/services/Services';
|
||||
|
||||
/**
|
||||
* Debounces calls to render terminal rows using animation frames.
|
||||
@@ -3,13 +3,13 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { MockCompositionHelper, MockRenderer, MockViewport, TestTerminal } from 'target-browser/TestUtils.test';
|
||||
import type { IBrowser } from 'target-browser/Types';
|
||||
import { MockCompositionHelper, MockRenderer, MockViewport, TestTerminal } from 'browser/TestUtils.test';
|
||||
import type { IBrowser } from 'browser/Types';
|
||||
import { assert } from 'chai';
|
||||
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { MockUnicodeService, createCellData } from 'common/TestUtils.test';
|
||||
import { IMarker } from 'common/Types';
|
||||
import { MockUnicodeService, createCellData } from 'common/terminal/TestUtils.test';
|
||||
import type { IMarker } from 'common/buffer/CellTypes';
|
||||
|
||||
const INIT_COLS = 80;
|
||||
const INIT_ROWS = 24;
|
||||
@@ -1146,7 +1146,7 @@ describe('Terminal', () => {
|
||||
assert.equal(termConverting.buffer.lines.get(1)!.translateToString(true), 'World');
|
||||
});
|
||||
|
||||
// FIXME: move to common/CoreTerminal.test once the trimming is moved over
|
||||
// FIXME: move to common/terminal/CoreTerminal.test once the trimming is moved over
|
||||
describe('marker lifecycle', () => {
|
||||
// create a 10x5 terminal with markers on every line
|
||||
// to test marker lifecycle under various terminal actions
|
||||
@@ -7,7 +7,7 @@ import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as pty from 'node-pty';
|
||||
import { CoreBrowserTerminal } from 'target-browser/CoreBrowserTerminal';
|
||||
import { CoreBrowserTerminal } from 'browser/CoreBrowserTerminal';
|
||||
import { IDisposable } from '@xterm/xterm';
|
||||
|
||||
// all test files expect terminal in 80x25
|
||||
@@ -4,21 +4,26 @@
|
||||
*/
|
||||
|
||||
import { IDisposable, IMarker, ILinkProvider, IDecorationOptions, IDecoration, IRenderDimensions as IRenderDimensionsApi } from '@xterm/xterm';
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IMouseService, IRenderService, ISelectionService, IThemeService } from 'target-browser/services/Services';
|
||||
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'target-browser/renderer/shared/Types';
|
||||
import { IColorSet, ITerminal, ILinkifier2, IBrowser, IViewport, ICompositionHelper, CharacterJoinerHandler, IBufferRange, ReadonlyColorSet, IBufferElementProvider } from 'target-browser/Types';
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IMouseService, IRenderService, ISelectionService, IThemeService } from 'browser/services/Services';
|
||||
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/shared/Types';
|
||||
import { IColorSet, ITerminal, ILinkifier2, IBrowser, IViewport, ICompositionHelper, CharacterJoinerHandler, IBufferRange, ReadonlyColorSet, IBufferElementProvider } from 'browser/Types';
|
||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||
import { IBufferLine, ICellData, IAttributeData, ICircularList, XtermListener, ICharset, ITerminalOptions, ColorIndex } from 'common/Types';
|
||||
import type { ICircularList } from 'common/base/CircularList';
|
||||
import type { IBufferLine, ICellData, IAttributeData } from 'common/buffer/CellTypes';
|
||||
import type { ICharset } from 'common/base/Charsets';
|
||||
import type { ITerminalOptions } from 'common/services/Services';
|
||||
import type { XtermListener } from 'common/terminal/CoreTerminalTypes';
|
||||
import { ColorIndex } from 'common/terminal/InputHandlerTypes';
|
||||
import { Buffer } from 'common/buffer/Buffer';
|
||||
import * as Browser from 'common/Platform';
|
||||
import { CoreBrowserTerminal } from 'target-browser/CoreBrowserTerminal';
|
||||
import * as Browser from 'common/base/Platform';
|
||||
import { CoreBrowserTerminal } from 'browser/CoreBrowserTerminal';
|
||||
import { IUnicodeService, IOptionsService, ICoreService, IMouseStateService } from 'common/services/Services';
|
||||
import { IFunctionIdentifier, IParams } from 'common/parser/Types';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
import { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from 'target-browser/selection/Types';
|
||||
import { css } from 'common/Color';
|
||||
import { createRenderDimensions } from 'target-browser/renderer/shared/RendererUtils';
|
||||
import { Emitter, type IEvent } from 'common/Event';
|
||||
import { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';
|
||||
import { css } from 'common/base/Color';
|
||||
import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';
|
||||
import { Emitter, type IEvent } from 'common/base/Event';
|
||||
|
||||
export class TestTerminal extends CoreBrowserTerminal {
|
||||
public get curAttrData(): IAttributeData { return (this as any)._inputHandler._curAttrData; }
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
const RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second
|
||||
|
||||
import { IRenderDebouncer } from 'target-browser/Types';
|
||||
import { IRenderDebouncer } from 'browser/Types';
|
||||
|
||||
/**
|
||||
* Debounces calls to update screen readers to update at most once configurable interval of time.
|
||||
@@ -3,11 +3,14 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { CharData, IColor, ICoreTerminal, ITerminalOptions } from 'common/Types';
|
||||
import type { CharData } from 'common/buffer/CellTypes';
|
||||
import type { IColor } from 'common/base/ColorTypes';
|
||||
import type { ICoreTerminal } from 'common/terminal/CoreTerminalTypes';
|
||||
import type { ITerminalOptions } from 'common/services/Services';
|
||||
import { IBuffer } from 'common/buffer/Types';
|
||||
import { IDisposable, IRenderDimensions as IRenderDimensionsApi, Terminal as ITerminalApi } from '@xterm/xterm';
|
||||
import { channels, css } from 'common/Color';
|
||||
import type { IEvent } from 'common/Event';
|
||||
import { channels, css } from 'common/base/Color';
|
||||
import type { IEvent } from 'common/base/Event';
|
||||
|
||||
/**
|
||||
* A portion of the public API that are implemented identially internally and simply passed through.
|
||||
@@ -3,16 +3,16 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { ICoreBrowserService, IRenderService, IThemeService } from 'target-browser/services/Services';
|
||||
import { ViewportConstants } from 'target-browser/shared/Constants';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
||||
import { ViewportConstants } from 'browser/shared/Constants';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { IBufferService, ICoreService, IMouseStateService, IOptionsService } from 'common/services/Services';
|
||||
import { CoreMouseEventType } from 'common/Types';
|
||||
import { scheduleAtNextAnimationFrame } from 'target-browser/Dom';
|
||||
import { SmoothScrollableElement } from 'target-browser/scrollable/scrollableElement';
|
||||
import type { IScrollableElementChangeOptions } from 'target-browser/scrollable/scrollableElementOptions';
|
||||
import { Emitter, EventUtils } from 'common/Event';
|
||||
import { Scrollable, ScrollbarVisibility, type IScrollEvent } from 'target-browser/scrollable/scrollable';
|
||||
import { CoreMouseEventType } from 'common/services/Types';
|
||||
import { scheduleAtNextAnimationFrame } from 'browser/Dom';
|
||||
import { SmoothScrollableElement } from 'browser/scrollable/scrollableElement';
|
||||
import type { IScrollableElementChangeOptions } from 'browser/scrollable/scrollableElementOptions';
|
||||
import { Emitter, EventUtils } from 'common/base/Event';
|
||||
import { Scrollable, ScrollbarVisibility, type IScrollEvent } from 'browser/scrollable/scrollable';
|
||||
|
||||
export class Viewport extends Disposable {
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ICoreBrowserService, IRenderService } from 'target-browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { ICoreBrowserService, IRenderService } from 'browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { IBufferService, IDecorationService, IInternalDecoration } from 'common/services/Services';
|
||||
|
||||
export class BufferDecorationRenderer extends Disposable {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { ColorZoneStore } from 'target-browser/decorations/ColorZoneStore';
|
||||
import { ColorZoneStore } from 'browser/decorations/ColorZoneStore';
|
||||
|
||||
const optionsRedFull = {
|
||||
overviewRulerOptions: {
|
||||
+3
-3
@@ -3,9 +3,9 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ColorZoneStore, IColorZone, IColorZoneStore } from 'target-browser/decorations/ColorZoneStore';
|
||||
import { ICoreBrowserService, IRenderService, IThemeService } from 'target-browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { ColorZoneStore, IColorZone, IColorZoneStore } from 'browser/decorations/ColorZoneStore';
|
||||
import { ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
||||
import { Disposable, toDisposable } from 'common/base/Lifecycle';
|
||||
import { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';
|
||||
|
||||
const enum Constants {
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { CompositionHelper } from 'target-browser/input/CompositionHelper';
|
||||
import { MockRenderService } from 'target-browser/TestUtils.test';
|
||||
import { MockCoreService, MockBufferService, MockOptionsService } from 'common/TestUtils.test';
|
||||
import { CompositionHelper } from 'browser/input/CompositionHelper';
|
||||
import { MockRenderService } from 'browser/TestUtils.test';
|
||||
import { MockCoreService, MockBufferService, MockOptionsService } from 'common/terminal/TestUtils.test';
|
||||
|
||||
describe('CompositionHelper', () => {
|
||||
let compositionHelper: CompositionHelper;
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IRenderService } from 'target-browser/services/Services';
|
||||
import { IRenderService } from 'browser/services/Services';
|
||||
import { IBufferService, ICoreService, IOptionsService } from 'common/services/Services';
|
||||
import { C0 } from 'common/data/EscapeSequences';
|
||||
import { C0 } from 'common/base/EscapeSequences';
|
||||
|
||||
interface IPosition {
|
||||
start: number;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import jsdom = require('jsdom');
|
||||
import { assert } from 'chai';
|
||||
import { getCoords } from 'target-browser/input/Mouse';
|
||||
import { getCoords } from 'browser/input/Mouse';
|
||||
|
||||
const CHAR_WIDTH = 10;
|
||||
const CHAR_HEIGHT = 20;
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { MockBufferService } from 'common/TestUtils.test';
|
||||
import { MockBufferService } from 'common/terminal/TestUtils.test';
|
||||
import { moveToCellSequence } from './MoveToCell';
|
||||
|
||||
describe('MoveToCell', () => {
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { C0 } from 'common/data/EscapeSequences';
|
||||
import { C0 } from 'common/base/EscapeSequences';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
|
||||
const enum Direction {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user