@xterm/xterm 6.1.0-beta.260 → 6.1.0-beta.262
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +7 -7
- package/lib/xterm.mjs.map +4 -4
- package/package.json +2 -2
- package/src/browser/OscLinkProvider.ts +1 -1
- package/src/browser/Types.ts +3 -2
- package/src/browser/input/Mouse.ts +3 -3
- package/src/browser/renderer/dom/DomRendererRowFactory.ts +2 -1
- package/src/browser/scrollable/mouseEvent.ts +1 -1
- package/src/browser/services/CharacterJoinerService.ts +1 -1
- package/src/browser/services/SelectionService.ts +2 -2
- package/src/common/CircularList.ts +23 -2
- package/src/common/Color.ts +3 -3
- package/src/common/CoreTerminal.ts +20 -4
- package/src/common/InputHandler.ts +4 -4
- package/src/common/Platform.ts +1 -1
- package/src/common/Types.ts +25 -183
- package/src/common/Version.ts +1 -1
- package/src/common/buffer/AttributeData.ts +2 -1
- package/src/common/buffer/Buffer.ts +2 -2
- package/src/common/buffer/BufferLine.ts +1 -1
- package/src/common/buffer/BufferReflow.ts +1 -1
- package/src/common/buffer/BufferSet.ts +1 -2
- package/src/common/buffer/CellData.ts +1 -1
- package/src/common/buffer/Marker.ts +2 -2
- package/src/common/buffer/Types.ts +147 -1
- package/src/common/input/UnicodeV6.ts +1 -0
- package/src/common/parser/Types.ts +2 -26
- package/src/common/public/BufferLineApiView.ts +1 -1
- package/src/common/public/BufferNamespaceApi.ts +1 -1
- package/src/common/public/ParserApi.ts +1 -1
- package/src/common/public/UnicodeApi.ts +1 -1
- package/src/common/services/BufferService.ts +1 -2
- package/src/common/services/DecorationService.ts +2 -2
- package/src/common/services/InstantiationService.ts +2 -2
- package/src/common/services/OscLinkService.ts +2 -1
- package/src/common/services/ServiceRegistry.ts +5 -1
- package/src/common/services/Services.ts +3 -9
- package/src/common/services/UnicodeService.ts +4 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "6.1.0-beta.
|
|
4
|
+
"version": "6.1.0-beta.262",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"ws": "^8.20.0",
|
|
117
117
|
"xterm-benchmark": "^0.3.2"
|
|
118
118
|
},
|
|
119
|
-
"commit": "
|
|
119
|
+
"commit": "6fd6003d6cce7d0e2552052c2550d0f5d0afcd0e"
|
|
120
120
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { IBufferRange, ILink } from './Types';
|
|
7
7
|
import { ILinkProvider } from './services/Services';
|
|
8
8
|
import { CellData } from '../common/buffer/CellData';
|
|
9
|
-
import { IBufferLine } from '../common/Types';
|
|
9
|
+
import { IBufferLine } from '../common/buffer/Types';
|
|
10
10
|
import { IBufferService, IOptionsService, IOscLinkService } from '../common/services/Services';
|
|
11
11
|
|
|
12
12
|
export class OscLinkProvider implements ILinkProvider {
|
package/src/browser/Types.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { IBuffer } from '../common/buffer/Types';
|
|
6
|
+
import { IColor, ITerminalOptions } from '../common/Types';
|
|
7
|
+
import { CharData, IBuffer } from '../common/buffer/Types';
|
|
8
|
+
import { ICoreTerminal } from '../common/CoreTerminal';
|
|
8
9
|
import { IDisposable, IRenderDimensions as IRenderDimensionsApi, Terminal as ITerminalApi } from '@xterm/xterm';
|
|
9
10
|
import { channels, css } from '../common/Color';
|
|
10
11
|
import type { IEvent } from '../common/Event';
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
export function getCoordsRelativeToElement(window: Pick<Window, 'getComputedStyle'>, event: {clientX: number, clientY: number}, element: HTMLElement): [number, number] {
|
|
7
7
|
const rect = element.getBoundingClientRect();
|
|
8
8
|
const elementStyle = window.getComputedStyle(element);
|
|
9
|
-
const leftPadding = parseInt(elementStyle.getPropertyValue('padding-left'));
|
|
10
|
-
const topPadding = parseInt(elementStyle.getPropertyValue('padding-top'));
|
|
9
|
+
const leftPadding = parseInt(elementStyle.getPropertyValue('padding-left'), 10);
|
|
10
|
+
const topPadding = parseInt(elementStyle.getPropertyValue('padding-top'), 10);
|
|
11
11
|
return [
|
|
12
12
|
event.clientX - rect.left - leftPadding,
|
|
13
13
|
event.clientY - rect.top - topPadding
|
|
@@ -22,7 +22,7 @@ export function getCoordsRelativeToElement(window: Pick<Window, 'getComputedStyl
|
|
|
22
22
|
* @param event The mouse event.
|
|
23
23
|
* @param element The terminal's container element.
|
|
24
24
|
* @param colCount The number of columns in the terminal.
|
|
25
|
-
* @param rowCount The number of rows
|
|
25
|
+
* @param rowCount The number of rows in the terminal.
|
|
26
26
|
* @param hasValidCharSize Whether there is a valid character size available.
|
|
27
27
|
* @param cssCellWidth The cell width device pixel render dimensions.
|
|
28
28
|
* @param cssCellHeight The cell height device pixel render dimensions.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IColor } from '../../../common/Types';
|
|
7
|
+
import { IBufferLine, ICellData } from '../../../common/buffer/Types';
|
|
7
8
|
import { INVERTED_DEFAULT_COLOR } from '../shared/Constants';
|
|
8
9
|
import { WHITESPACE_CELL_CHAR, Attributes } from '../../../common/buffer/Constants';
|
|
9
10
|
import { CellData } from '../../../common/buffer/CellData';
|
|
@@ -217,7 +217,7 @@ export class StandardWheelEvent {
|
|
|
217
217
|
let shouldFactorDPR: boolean = false;
|
|
218
218
|
if (platform.isChrome) {
|
|
219
219
|
const chromeVersionMatch = navigator.userAgent.match(/Chrome\/(\d+)/);
|
|
220
|
-
const chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;
|
|
220
|
+
const chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1], 10) : 123;
|
|
221
221
|
shouldFactorDPR = chromeMajorVersion <= 122;
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IBufferLine, ICellData
|
|
6
|
+
import { CharData, IBufferLine, ICellData } from '../../common/buffer/Types';
|
|
7
7
|
import { ICharacterJoiner } from '../Types';
|
|
8
8
|
import { AttributeData } from '../../common/buffer/AttributeData';
|
|
9
9
|
import { WHITESPACE_CELL_CHAR, Content } from '../../common/buffer/Constants';
|
|
@@ -11,10 +11,10 @@ import { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from
|
|
|
11
11
|
import { ICoreBrowserService, IMouseCoordsService, IRenderService, ISelectionService } from './Services';
|
|
12
12
|
import { Disposable, MutableDisposable, toDisposable } from '../../common/Lifecycle';
|
|
13
13
|
import * as Browser from '../../common/Platform';
|
|
14
|
-
import {
|
|
14
|
+
import { IDisposable } from '../../common/Types';
|
|
15
|
+
import { IBuffer, IBufferLine, ICellData } from '../../common/buffer/Types';
|
|
15
16
|
import { getRangeLength } from '../../common/buffer/BufferRange';
|
|
16
17
|
import { CellData } from '../../common/buffer/CellData';
|
|
17
|
-
import { IBuffer } from '../../common/buffer/Types';
|
|
18
18
|
import { IBufferService, ICoreService, IMouseStateService, IOptionsService } from '../../common/services/Services';
|
|
19
19
|
import { Emitter } from '../../common/Event';
|
|
20
20
|
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ICircularList } from './Types';
|
|
7
6
|
import { Disposable } from './Lifecycle';
|
|
8
|
-
import { Emitter } from './Event';
|
|
7
|
+
import { Emitter, type IEvent } from './Event';
|
|
9
8
|
|
|
10
9
|
export interface IInsertEvent {
|
|
11
10
|
index: number;
|
|
@@ -17,6 +16,28 @@ export interface IDeleteEvent {
|
|
|
17
16
|
amount: number;
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
export interface ICircularList<T> {
|
|
20
|
+
length: number;
|
|
21
|
+
maxLength: number;
|
|
22
|
+
isFull: boolean;
|
|
23
|
+
|
|
24
|
+
onDeleteEmitter: Emitter<IDeleteEvent>;
|
|
25
|
+
onDelete: IEvent<IDeleteEvent>;
|
|
26
|
+
onInsertEmitter: Emitter<IInsertEvent>;
|
|
27
|
+
onInsert: IEvent<IInsertEvent>;
|
|
28
|
+
onTrimEmitter: Emitter<number>;
|
|
29
|
+
onTrim: IEvent<number>;
|
|
30
|
+
|
|
31
|
+
get(index: number): T | undefined;
|
|
32
|
+
set(index: number, value: T): void;
|
|
33
|
+
push(value: T): void;
|
|
34
|
+
recycle(): T;
|
|
35
|
+
pop(): T | undefined;
|
|
36
|
+
splice(start: number, deleteCount: number, ...items: T[]): void;
|
|
37
|
+
trimStart(count: number): void;
|
|
38
|
+
shiftElements(start: number, count: number, offset: number): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
/**
|
|
21
42
|
* Represents a circular list; a list with a maximum size that wraps around when push is called,
|
|
22
43
|
* overriding values at the start of the list.
|
package/src/common/Color.ts
CHANGED
|
@@ -177,9 +177,9 @@ export namespace css {
|
|
|
177
177
|
// Formats: rgb() or rgba()
|
|
178
178
|
const rgbaMatch = css.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
|
|
179
179
|
if (rgbaMatch) {
|
|
180
|
-
$r = parseInt(rgbaMatch[1]);
|
|
181
|
-
$g = parseInt(rgbaMatch[2]);
|
|
182
|
-
$b = parseInt(rgbaMatch[3]);
|
|
180
|
+
$r = parseInt(rgbaMatch[1], 10);
|
|
181
|
+
$g = parseInt(rgbaMatch[2], 10);
|
|
182
|
+
$b = parseInt(rgbaMatch[3], 10);
|
|
183
183
|
$a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);
|
|
184
184
|
return channels.toColor($r, $g, $b, $a);
|
|
185
185
|
}
|
|
@@ -21,19 +21,20 @@
|
|
|
21
21
|
* http://linux.die.net/man/7/urxvt
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, IMouseStateService, IUnicodeService, LogLevelEnum,
|
|
24
|
+
import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, IMouseStateService, IUnicodeService, LogLevelEnum, IOscLinkService } from './services/Services';
|
|
25
25
|
import { InstantiationService } from './services/InstantiationService';
|
|
26
26
|
import { LogService } from './services/LogService';
|
|
27
27
|
import { BufferService, BufferServiceConstants } from './services/BufferService';
|
|
28
28
|
import { OptionsService } from './services/OptionsService';
|
|
29
|
-
import { IDisposable,
|
|
29
|
+
import { IDisposable, IScrollEvent, ITerminalOptions, IParams } from './Types';
|
|
30
|
+
import { IAttributeData, IBufferSet } from './buffer/Types';
|
|
30
31
|
import { CoreService } from './services/CoreService';
|
|
31
32
|
import { MouseStateService } from './services/MouseStateService';
|
|
33
|
+
import { UnicodeV6 } from './input/UnicodeV6';
|
|
32
34
|
import { UnicodeService } from './services/UnicodeService';
|
|
33
35
|
import { CharsetService } from './services/CharsetService';
|
|
34
36
|
import { updateWindowsModeWrappedState } from './WindowsMode';
|
|
35
|
-
import { IFunctionIdentifier
|
|
36
|
-
import { IBufferSet } from './buffer/Types';
|
|
37
|
+
import { IFunctionIdentifier } from './parser/Types';
|
|
37
38
|
import { InputHandler } from './InputHandler';
|
|
38
39
|
import { WriteBuffer } from './input/WriteBuffer';
|
|
39
40
|
import { OscLinkService } from './services/OscLinkService';
|
|
@@ -43,6 +44,20 @@ import { Disposable, MutableDisposable, toDisposable } from './Lifecycle';
|
|
|
43
44
|
// Only trigger this warning a single time per session
|
|
44
45
|
let hasWriteSyncWarnHappened = false;
|
|
45
46
|
|
|
47
|
+
export interface ICoreTerminal {
|
|
48
|
+
mouseStateService: IMouseStateService;
|
|
49
|
+
coreService: ICoreService;
|
|
50
|
+
optionsService: IOptionsService;
|
|
51
|
+
unicodeService: IUnicodeService;
|
|
52
|
+
buffers: IBufferSet;
|
|
53
|
+
options: Required<ITerminalOptions>;
|
|
54
|
+
registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable;
|
|
55
|
+
registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable;
|
|
56
|
+
registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise<boolean>): IDisposable;
|
|
57
|
+
registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
|
|
58
|
+
registerApcHandler(id: IFunctionIdentifier, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
|
|
59
|
+
}
|
|
60
|
+
|
|
46
61
|
export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
47
62
|
protected readonly _instantiationService: IInstantiationService;
|
|
48
63
|
protected readonly _bufferService: IBufferService;
|
|
@@ -116,6 +131,7 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|
|
116
131
|
this.mouseStateService = this._register(this._instantiationService.createInstance(MouseStateService));
|
|
117
132
|
this._instantiationService.setService(IMouseStateService, this.mouseStateService);
|
|
118
133
|
this.unicodeService = this._register(this._instantiationService.createInstance(UnicodeService));
|
|
134
|
+
this.unicodeService.register(new UnicodeV6());
|
|
119
135
|
this._instantiationService.setService(IUnicodeService, this.unicodeService);
|
|
120
136
|
this._charsetService = this._instantiationService.createInstance(CharsetService);
|
|
121
137
|
this._instantiationService.setService(ICharsetService, this._charsetService);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { IInputHandler,
|
|
7
|
+
import { IInputHandler, IDisposable, IWindowOptions, IColorEvent, IParseStack, ColorIndex, ColorRequestType, SpecialColorIndex } from './Types';
|
|
8
|
+
import { IAttributeData, IBuffer } from './buffer/Types';
|
|
8
9
|
import { C0, C1 } from './data/EscapeSequences';
|
|
9
10
|
import { CHARSETS, DEFAULT_CHARSET } from './data/Charsets';
|
|
10
11
|
import { EscapeSequenceParser } from './parser/EscapeSequenceParser';
|
|
@@ -20,7 +21,6 @@ import { UnicodeService } from './services/UnicodeService';
|
|
|
20
21
|
import { OscHandler } from './parser/OscParser';
|
|
21
22
|
import { DcsHandler } from './parser/DcsParser';
|
|
22
23
|
import { ApcHandler } from './parser/ApcParser';
|
|
23
|
-
import { IBuffer } from './buffer/Types';
|
|
24
24
|
import { parseColor } from './input/XParseColor';
|
|
25
25
|
import { Emitter } from './Event';
|
|
26
26
|
import { XTERM_VERSION } from './Version';
|
|
@@ -3065,7 +3065,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
3065
3065
|
const idx = slots.shift() as string;
|
|
3066
3066
|
const spec = slots.shift() as string;
|
|
3067
3067
|
if (/^\d+$/.exec(idx)) {
|
|
3068
|
-
const index = parseInt(idx);
|
|
3068
|
+
const index = parseInt(idx, 10);
|
|
3069
3069
|
if (isValidColorIndex(index)) {
|
|
3070
3070
|
if (spec === '?') {
|
|
3071
3071
|
event.push({ type: ColorRequestType.REPORT, index });
|
|
@@ -3228,7 +3228,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|
|
3228
3228
|
const slots = data.split(';');
|
|
3229
3229
|
for (let i = 0; i < slots.length; ++i) {
|
|
3230
3230
|
if (/^\d+$/.exec(slots[i])) {
|
|
3231
|
-
const index = parseInt(slots[i]);
|
|
3231
|
+
const index = parseInt(slots[i], 10);
|
|
3232
3232
|
if (isValidColorIndex(index)) {
|
|
3233
3233
|
event.push({ type: ColorRequestType.RESTORE, index });
|
|
3234
3234
|
}
|
package/src/common/Platform.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function getSafariVersion(): number {
|
|
|
41
41
|
if (majorVersion === null || majorVersion.length < 2) {
|
|
42
42
|
return 0;
|
|
43
43
|
}
|
|
44
|
-
return parseInt(majorVersion[1]);
|
|
44
|
+
return parseInt(majorVersion[1], 10);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Find the users platform. We use this to interpret the meta key
|
package/src/common/Types.ts
CHANGED
|
@@ -3,26 +3,32 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDeleteEvent, IInsertEvent } from './CircularList';
|
|
7
|
-
import { UnderlineStyle } from './buffer/Constants';
|
|
8
|
-
import { IBufferSet } from './buffer/Types';
|
|
9
|
-
import { IParams } from './parser/Types';
|
|
10
|
-
import { IMouseStateService, ICoreService, IOptionsService, IUnicodeService } from './services/Services';
|
|
11
6
|
import { IFunctionIdentifier, ITerminalOptions as IPublicTerminalOptions } from '@xterm/xterm';
|
|
12
|
-
import type {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
import type { IEvent } from './Event';
|
|
8
|
+
|
|
9
|
+
/** sequence params serialized to js arrays */
|
|
10
|
+
export type ParamsArray = (number | number[])[];
|
|
11
|
+
|
|
12
|
+
/** Interface of Params storage class. */
|
|
13
|
+
export interface IParams {
|
|
14
|
+
/** from ctor */
|
|
15
|
+
maxLength: number;
|
|
16
|
+
maxSubParamsLength: number;
|
|
17
|
+
|
|
18
|
+
/** param values and its length */
|
|
19
|
+
params: Int32Array;
|
|
20
|
+
length: number;
|
|
21
|
+
|
|
22
|
+
/** methods */
|
|
23
|
+
clone(): IParams;
|
|
24
|
+
toArray(): ParamsArray;
|
|
25
|
+
reset(): void;
|
|
26
|
+
resetZdm(): void;
|
|
27
|
+
addParam(value: number): void;
|
|
28
|
+
addSubParam(value: number): void;
|
|
29
|
+
hasSubParams(idx: number): boolean;
|
|
30
|
+
getSubParams(idx: number): Int32Array | null;
|
|
31
|
+
getSubParamsAll(): {[idx: number]: Int32Array};
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
export interface IDisposable {
|
|
@@ -62,28 +68,6 @@ export interface IScrollEvent {
|
|
|
62
68
|
position: number;
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
export interface ICircularList<T> {
|
|
66
|
-
length: number;
|
|
67
|
-
maxLength: number;
|
|
68
|
-
isFull: boolean;
|
|
69
|
-
|
|
70
|
-
onDeleteEmitter: Emitter<IDeleteEvent>;
|
|
71
|
-
onDelete: IEvent<IDeleteEvent>;
|
|
72
|
-
onInsertEmitter: Emitter<IInsertEvent>;
|
|
73
|
-
onInsert: IEvent<IInsertEvent>;
|
|
74
|
-
onTrimEmitter: Emitter<number>;
|
|
75
|
-
onTrim: IEvent<number>;
|
|
76
|
-
|
|
77
|
-
get(index: number): T | undefined;
|
|
78
|
-
set(index: number, value: T): void;
|
|
79
|
-
push(value: T): void;
|
|
80
|
-
recycle(): T;
|
|
81
|
-
pop(): T | undefined;
|
|
82
|
-
splice(start: number, deleteCount: number, ...items: T[]): void;
|
|
83
|
-
trimStart(count: number): void;
|
|
84
|
-
shiftElements(start: number, count: number, offset: number): void;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
71
|
export const enum KeyboardResultType {
|
|
88
72
|
SEND_KEY,
|
|
89
73
|
SELECT_ALL,
|
|
@@ -101,24 +85,12 @@ export interface ICharset {
|
|
|
101
85
|
[key: string]: string | undefined;
|
|
102
86
|
}
|
|
103
87
|
|
|
104
|
-
export type CharData = [attr: number, char: string, width: number, code: number];
|
|
105
|
-
|
|
106
88
|
export interface IColor {
|
|
107
89
|
readonly css: string;
|
|
108
90
|
readonly rgba: number; // 32-bit int with rgba in each byte
|
|
109
91
|
}
|
|
110
92
|
export type IColorRGB = [red: number, green: number, blue: number];
|
|
111
93
|
|
|
112
|
-
export interface IExtendedAttrs {
|
|
113
|
-
ext: number;
|
|
114
|
-
underlineStyle: UnderlineStyle;
|
|
115
|
-
underlineColor: number;
|
|
116
|
-
underlineVariantOffset: number;
|
|
117
|
-
urlId: number;
|
|
118
|
-
clone(): IExtendedAttrs;
|
|
119
|
-
isEmpty(): boolean;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
94
|
/**
|
|
123
95
|
* Tracks the current hyperlink. Since these are treated as extended attirbutes, these get passed on
|
|
124
96
|
* to the linkifier when anything is printed. Doing it this way ensures that even when the cursor
|
|
@@ -130,136 +102,6 @@ export interface IOscLinkData {
|
|
|
130
102
|
uri: string;
|
|
131
103
|
}
|
|
132
104
|
|
|
133
|
-
/**
|
|
134
|
-
* An object that represents all attributes of a cell.
|
|
135
|
-
*/
|
|
136
|
-
export interface IAttributeData {
|
|
137
|
-
/**
|
|
138
|
-
* "fg" is a 32-bit unsigned integer that stores the foreground color of the cell in the 24 least
|
|
139
|
-
* significant bits and additional flags in the remaining 8 bits.
|
|
140
|
-
*/
|
|
141
|
-
fg: number;
|
|
142
|
-
/**
|
|
143
|
-
* "bg" is a 32-bit unsigned integer that stores the background color of the cell in the 24 least
|
|
144
|
-
* significant bits and additional flags in the remaining 8 bits.
|
|
145
|
-
*/
|
|
146
|
-
bg: number;
|
|
147
|
-
/**
|
|
148
|
-
* "extended", aka "ext", stores extended attributes beyond those available in fg and bg. This
|
|
149
|
-
* data is optional on a cell and encodes less common data.
|
|
150
|
-
*/
|
|
151
|
-
extended: IExtendedAttrs;
|
|
152
|
-
|
|
153
|
-
clone(): IAttributeData;
|
|
154
|
-
|
|
155
|
-
// flags
|
|
156
|
-
isInverse(): number;
|
|
157
|
-
isBold(): number;
|
|
158
|
-
isUnderline(): number;
|
|
159
|
-
isBlink(): number;
|
|
160
|
-
isInvisible(): number;
|
|
161
|
-
isItalic(): number;
|
|
162
|
-
isDim(): number;
|
|
163
|
-
isStrikethrough(): number;
|
|
164
|
-
isProtected(): number;
|
|
165
|
-
isOverline(): number;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* The color mode of the foreground color which determines how to decode {@link getFgColor},
|
|
169
|
-
* possible values include {@link Attributes.CM_DEFAULT}, {@link Attributes.CM_P16},
|
|
170
|
-
* {@link Attributes.CM_P256} and {@link Attributes.CM_RGB}.
|
|
171
|
-
*/
|
|
172
|
-
getFgColorMode(): number;
|
|
173
|
-
/**
|
|
174
|
-
* The color mode of the background color which determines how to decode {@link getBgColor},
|
|
175
|
-
* possible values include {@link Attributes.CM_DEFAULT}, {@link Attributes.CM_P16},
|
|
176
|
-
* {@link Attributes.CM_P256} and {@link Attributes.CM_RGB}.
|
|
177
|
-
*/
|
|
178
|
-
getBgColorMode(): number;
|
|
179
|
-
isFgRGB(): boolean;
|
|
180
|
-
isBgRGB(): boolean;
|
|
181
|
-
isFgPalette(): boolean;
|
|
182
|
-
isBgPalette(): boolean;
|
|
183
|
-
isFgDefault(): boolean;
|
|
184
|
-
isBgDefault(): boolean;
|
|
185
|
-
isAttributeDefault(): boolean;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Gets an integer representation of the foreground color, how to decode the color depends on the
|
|
189
|
-
* color mode {@link getFgColorMode}.
|
|
190
|
-
*/
|
|
191
|
-
getFgColor(): number;
|
|
192
|
-
/**
|
|
193
|
-
* Gets an integer representation of the background color, how to decode the color depends on the
|
|
194
|
-
* color mode {@link getBgColorMode}.
|
|
195
|
-
*/
|
|
196
|
-
getBgColor(): number;
|
|
197
|
-
|
|
198
|
-
// extended attrs
|
|
199
|
-
hasExtendedAttrs(): number;
|
|
200
|
-
updateExtended(): void;
|
|
201
|
-
getUnderlineColor(): number;
|
|
202
|
-
getUnderlineColorMode(): number;
|
|
203
|
-
isUnderlineColorRGB(): boolean;
|
|
204
|
-
isUnderlineColorPalette(): boolean;
|
|
205
|
-
isUnderlineColorDefault(): boolean;
|
|
206
|
-
getUnderlineStyle(): number;
|
|
207
|
-
getUnderlineVariantOffset(): number;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/** Cell data */
|
|
211
|
-
export interface ICellData extends IAttributeData {
|
|
212
|
-
content: number;
|
|
213
|
-
combinedData: string;
|
|
214
|
-
isCombined(): number;
|
|
215
|
-
getWidth(): number;
|
|
216
|
-
getChars(): string;
|
|
217
|
-
getCode(): number;
|
|
218
|
-
setFromCharData(value: CharData): void;
|
|
219
|
-
getAsCharData(): CharData;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Interface for a line in the terminal buffer.
|
|
224
|
-
*/
|
|
225
|
-
export interface IBufferLine {
|
|
226
|
-
length: number;
|
|
227
|
-
isWrapped: boolean;
|
|
228
|
-
get(index: number): CharData;
|
|
229
|
-
set(index: number, value: CharData): void;
|
|
230
|
-
loadCell(index: number, cell: ICellData): ICellData;
|
|
231
|
-
setCell(index: number, cell: ICellData): void;
|
|
232
|
-
setCellFromCodepoint(index: number, codePoint: number, width: number, attrs: IAttributeData): void;
|
|
233
|
-
addCodepointToCell(index: number, codePoint: number, width: number): void;
|
|
234
|
-
insertCells(pos: number, n: number, ch: ICellData): void;
|
|
235
|
-
deleteCells(pos: number, n: number, fill: ICellData): void;
|
|
236
|
-
replaceCells(start: number, end: number, fill: ICellData, respectProtect?: boolean): void;
|
|
237
|
-
resize(cols: number, fill: ICellData): boolean;
|
|
238
|
-
cleanupMemory(): number;
|
|
239
|
-
fill(fillCellData: ICellData, respectProtect?: boolean): void;
|
|
240
|
-
copyFrom(line: IBufferLine): void;
|
|
241
|
-
clone(): IBufferLine;
|
|
242
|
-
getTrimmedLength(): number;
|
|
243
|
-
getNoBgTrimmedLength(): number;
|
|
244
|
-
translateToString(trimRight?: boolean, startCol?: number, endCol?: number, outColumns?: number[]): string;
|
|
245
|
-
|
|
246
|
-
/* direct access to cell attrs */
|
|
247
|
-
getWidth(index: number): number;
|
|
248
|
-
hasWidth(index: number): number;
|
|
249
|
-
getFg(index: number): number;
|
|
250
|
-
getBg(index: number): number;
|
|
251
|
-
hasContent(index: number): number;
|
|
252
|
-
getCodePoint(index: number): number;
|
|
253
|
-
isCombined(index: number): number;
|
|
254
|
-
getString(index: number): string;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface IMarker extends IDisposable {
|
|
258
|
-
readonly id: number;
|
|
259
|
-
readonly isDisposed: boolean;
|
|
260
|
-
readonly line: number;
|
|
261
|
-
onDispose: IEvent<void>;
|
|
262
|
-
}
|
|
263
105
|
export interface IModes {
|
|
264
106
|
insertMode: boolean;
|
|
265
107
|
}
|
package/src/common/Version.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IColorRGB } from '../Types';
|
|
7
|
+
import { IAttributeData, IExtendedAttrs } from './Types';
|
|
7
8
|
import { Attributes, FgFlags, BgFlags, UnderlineStyle, ExtFlags } from './Constants';
|
|
8
9
|
|
|
9
10
|
export class AttributeData implements IAttributeData {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import { CircularList, IInsertEvent } from '../CircularList';
|
|
7
7
|
import { Disposable, toDisposable } from '../Lifecycle';
|
|
8
8
|
import { IdleTaskQueue } from '../TaskQueue';
|
|
9
|
-
import {
|
|
9
|
+
import { ICharset } from '../Types';
|
|
10
|
+
import { IAttributeData, IBuffer, IBufferLine, ICellData } from './Types';
|
|
10
11
|
import { ExtendedAttrs } from './AttributeData';
|
|
11
12
|
import { BufferLine, DEFAULT_ATTR_DATA } from './BufferLine';
|
|
12
13
|
import { BufferLineStringCache } from './BufferLineStringCache';
|
|
@@ -14,7 +15,6 @@ import { getWrappedLineTrimmedLength, reflowLargerApplyNewLayout, reflowLargerCr
|
|
|
14
15
|
import { CellData } from './CellData';
|
|
15
16
|
import { NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE, WHITESPACE_CELL_WIDTH } from './Constants';
|
|
16
17
|
import { Marker } from './Marker';
|
|
17
|
-
import { IBuffer } from './Types';
|
|
18
18
|
import { DEFAULT_CHARSET } from '../data/Charsets';
|
|
19
19
|
import { IBufferService, ILogService, IOptionsService } from '../services/Services';
|
|
20
20
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { CharData, IAttributeData, IBufferLine, ICellData, IExtendedAttrs } from '
|
|
6
|
+
import { CharData, IAttributeData, IBufferLine, ICellData, IExtendedAttrs } from './Types';
|
|
7
7
|
import { AttributeData } from './AttributeData';
|
|
8
8
|
import { CellData } from './CellData';
|
|
9
9
|
import { Attributes, BgFlags, CHAR_DATA_ATTR_INDEX, CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, Content, NULL_CELL_CHAR, NULL_CELL_CODE, NULL_CELL_WIDTH, WHITESPACE_CELL_CHAR } from './Constants';
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Disposable, MutableDisposable } from '../Lifecycle';
|
|
7
|
-
import { IAttributeData } from '../Types';
|
|
8
7
|
import { Buffer } from './Buffer';
|
|
9
|
-
import { IBuffer, IBufferSet } from './Types';
|
|
8
|
+
import { IAttributeData, IBuffer, IBufferSet } from './Types';
|
|
10
9
|
import { IBufferService, ILogService, IOptionsService } from '../services/Services';
|
|
11
10
|
import { Emitter } from '../Event';
|
|
12
11
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { CharData, ICellData, IExtendedAttrs } from '
|
|
6
|
+
import { CharData, ICellData, IExtendedAttrs } from './Types';
|
|
7
7
|
import { stringFromCodePoint } from '../input/TextDecoder';
|
|
8
8
|
import { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, Content } from './Constants';
|
|
9
9
|
import { AttributeData, ExtendedAttrs } from './AttributeData';
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { dispose, IDisposable } from '../Lifecycle';
|
|
7
|
+
import { IMarker } from './Types';
|
|
7
8
|
import { Emitter } from '../Event';
|
|
8
|
-
import { dispose } from '../Lifecycle';
|
|
9
9
|
|
|
10
10
|
export class Marker implements IMarker {
|
|
11
11
|
private static _nextId = 1;
|