Merge remote-tracking branch 'upstream/master' into pr/aymanbagabas/4220
This commit is contained in:
+16
-20
@@ -50,7 +50,7 @@ const GLEVEL: { [key: string]: number } = { '(': 0, ')': 1, '*': 2, '+': 3, '-':
|
||||
/**
|
||||
* Document xterm VT features here that are currently unsupported
|
||||
*/
|
||||
// @vt: #E[Supported via xterm-addon-image.] DCS SIXEL "SIXEL Graphics" "DCS Ps ; Ps ; Ps ; q Pt ST" "Draw SIXEL image."
|
||||
// @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL "SIXEL Graphics" "DCS Ps ; Ps ; Ps ; q Pt ST" "Draw SIXEL image."
|
||||
// @vt: #N DCS DECUDK "User Defined Keys" "DCS Ps ; Ps \| Pt ST" "Definitions for user-defined keys."
|
||||
// @vt: #N DCS XTGETTCAP "Request Terminfo String" "DCS + q Pt ST" "Request Terminfo String."
|
||||
// @vt: #N DCS XTSETTCAP "Set Terminfo Data" "DCS + p Pt ST" "Set Terminfo Data."
|
||||
@@ -523,7 +523,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
|
||||
// handle wide chars: reset start_cell-1 if we would overwrite the second cell of a wide char
|
||||
if (this._activeBuffer.x && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {
|
||||
bufferRow.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, curAttr);
|
||||
}
|
||||
|
||||
let precedingJoinState = this._parser.precedingJoinState;
|
||||
@@ -585,7 +585,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
}
|
||||
// clear left over cells to the right
|
||||
while (oldCol < cols) {
|
||||
oldRow.setCellFromCodePoint(oldCol++, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
oldRow.setCellFromCodepoint(oldCol++, 0, 1, curAttr);
|
||||
}
|
||||
} else {
|
||||
this._activeBuffer.x = cols - 1;
|
||||
@@ -609,7 +609,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
bufferRow.addCodepointToCell(this._activeBuffer.x - offset,
|
||||
code, chWidth);
|
||||
for (let delta = chWidth - oldWidth; --delta >= 0; ) {
|
||||
bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -617,17 +617,17 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
// insert mode: move characters to right
|
||||
if (insertMode) {
|
||||
// right shift cells according to the width
|
||||
bufferRow.insertCells(this._activeBuffer.x, chWidth - oldWidth, this._activeBuffer.getNullCell(curAttr), curAttr);
|
||||
bufferRow.insertCells(this._activeBuffer.x, chWidth - oldWidth, this._activeBuffer.getNullCell(curAttr));
|
||||
// test last cell - since the last cell has only room for
|
||||
// a halfwidth char any fullwidth shifted there is lost
|
||||
// and will be set to empty cell
|
||||
if (bufferRow.getWidth(cols - 1) === 2) {
|
||||
bufferRow.setCellFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr);
|
||||
}
|
||||
}
|
||||
|
||||
// write current char to buffer and advance cursor
|
||||
bufferRow.setCellFromCodePoint(this._activeBuffer.x++, code, chWidth, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(this._activeBuffer.x++, code, chWidth, curAttr);
|
||||
|
||||
// fullwidth char - also set next cell to placeholder stub and advance cursor
|
||||
// for graphemes bigger than fullwidth we can simply loop to zero
|
||||
@@ -635,7 +635,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
if (chWidth > 0) {
|
||||
while (--chWidth) {
|
||||
// other than a regular empty cell a cell following a wide char has no width
|
||||
bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, curAttr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -644,7 +644,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
|
||||
// handle wide chars: reset cell to the right if it is second cell of a wide char
|
||||
if (this._activeBuffer.x < cols && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {
|
||||
bufferRow.setCellFromCodePoint(this._activeBuffer.x, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);
|
||||
bufferRow.setCellFromCodepoint(this._activeBuffer.x, 0, 1, curAttr);
|
||||
}
|
||||
|
||||
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
||||
@@ -1149,7 +1149,6 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
start,
|
||||
end,
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
||||
this._eraseAttrData(),
|
||||
respectProtect
|
||||
);
|
||||
if (clearWrap) {
|
||||
@@ -1370,8 +1369,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
line.insertCells(
|
||||
this._activeBuffer.x,
|
||||
params.params[0] || 1,
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
||||
this._eraseAttrData()
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData())
|
||||
);
|
||||
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
||||
}
|
||||
@@ -1397,8 +1395,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
line.deleteCells(
|
||||
this._activeBuffer.x,
|
||||
params.params[0] || 1,
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
||||
this._eraseAttrData()
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData())
|
||||
);
|
||||
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
||||
}
|
||||
@@ -1465,7 +1462,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
const param = params.params[0] || 1;
|
||||
for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {
|
||||
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
|
||||
line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());
|
||||
line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()));
|
||||
line.isWrapped = false;
|
||||
}
|
||||
this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
|
||||
@@ -1498,7 +1495,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
const param = params.params[0] || 1;
|
||||
for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {
|
||||
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
|
||||
line.insertCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());
|
||||
line.insertCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()));
|
||||
line.isWrapped = false;
|
||||
}
|
||||
this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
|
||||
@@ -1521,7 +1518,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
const param = params.params[0] || 1;
|
||||
for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {
|
||||
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
|
||||
line.insertCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());
|
||||
line.insertCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()));
|
||||
line.isWrapped = false;
|
||||
}
|
||||
this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
|
||||
@@ -1544,7 +1541,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
const param = params.params[0] || 1;
|
||||
for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {
|
||||
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
|
||||
line.deleteCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());
|
||||
line.deleteCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()));
|
||||
line.isWrapped = false;
|
||||
}
|
||||
this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
|
||||
@@ -1566,8 +1563,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
line.replaceCells(
|
||||
this._activeBuffer.x,
|
||||
this._activeBuffer.x + (params.params[0] || 1),
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData()),
|
||||
this._eraseAttrData()
|
||||
this._activeBuffer.getNullCell(this._eraseAttrData())
|
||||
);
|
||||
this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IBufferSet, IBuffer } from 'common/buffer/Types';
|
||||
import { BufferSet } from 'common/buffer/BufferSet';
|
||||
import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEventType, ICharset, IModes, IAttributeData, IOscLinkData, IDisposable } from 'common/Types';
|
||||
import { UnicodeV6 } from 'common/input/UnicodeV6';
|
||||
import { IDecorationOptions, IDecoration } from 'xterm';
|
||||
import { IDecorationOptions, IDecoration } from '@xterm/xterm';
|
||||
|
||||
export class MockBufferService implements IBufferService {
|
||||
public serviceBrand: any;
|
||||
|
||||
Vendored
+8
-6
@@ -9,7 +9,7 @@ import { Attributes, UnderlineStyle } from 'common/buffer/Constants'; // eslint-
|
||||
import { IBufferSet } from 'common/buffer/Types';
|
||||
import { IParams } from 'common/parser/Types';
|
||||
import { ICoreMouseService, ICoreService, IOptionsService, IUnicodeService } from 'common/services/Services';
|
||||
import { ClipboardSelectionType as ClipboardSelectionType, IFunctionIdentifier, ITerminalOptions as IPublicTerminalOptions } from 'xterm';
|
||||
import { ClipboardSelectionType as ClipboardSelectionType, IFunctionIdentifier, ITerminalOptions as IPublicTerminalOptions } from '@xterm/xterm';
|
||||
|
||||
export interface ICoreTerminal {
|
||||
coreMouseService: ICoreMouseService;
|
||||
@@ -119,6 +119,7 @@ export interface IExtendedAttrs {
|
||||
ext: number;
|
||||
underlineStyle: UnderlineStyle;
|
||||
underlineColor: number;
|
||||
underlineVariantOffset: number;
|
||||
urlId: number;
|
||||
clone(): IExtendedAttrs;
|
||||
isEmpty(): boolean;
|
||||
@@ -209,6 +210,7 @@ export interface IAttributeData {
|
||||
isUnderlineColorPalette(): boolean;
|
||||
isUnderlineColorDefault(): boolean;
|
||||
getUnderlineStyle(): number;
|
||||
getUnderlineVariantOffset(): number;
|
||||
}
|
||||
|
||||
/** Cell data */
|
||||
@@ -233,11 +235,11 @@ export interface IBufferLine {
|
||||
set(index: number, value: CharData): void;
|
||||
loadCell(index: number, cell: ICellData): ICellData;
|
||||
setCell(index: number, cell: ICellData): void;
|
||||
setCellFromCodePoint(index: number, codePoint: number, width: number, fg: number, bg: number, eAttrs: IExtendedAttrs): void;
|
||||
setCellFromCodepoint(index: number, codePoint: number, width: number, attrs: IAttributeData): void;
|
||||
addCodepointToCell(index: number, codePoint: number, width: number): void;
|
||||
insertCells(pos: number, n: number, ch: ICellData, eraseAttr?: IAttributeData): void;
|
||||
deleteCells(pos: number, n: number, fill: ICellData, eraseAttr?: IAttributeData): void;
|
||||
replaceCells(start: number, end: number, fill: ICellData, eraseAttr?: IAttributeData, respectProtect?: boolean): void;
|
||||
insertCells(pos: number, n: number, ch: ICellData): void;
|
||||
deleteCells(pos: number, n: number, fill: ICellData): void;
|
||||
replaceCells(start: number, end: number, fill: ICellData, respectProtect?: boolean): void;
|
||||
resize(cols: number, fill: ICellData): boolean;
|
||||
cleanupMemory(): number;
|
||||
fill(fillCellData: ICellData, respectProtect?: boolean): void;
|
||||
@@ -245,7 +247,7 @@ export interface IBufferLine {
|
||||
clone(): IBufferLine;
|
||||
getTrimmedLength(): number;
|
||||
getNoBgTrimmedLength(): number;
|
||||
translateToString(trimRight?: boolean, startCol?: number, endCol?: number): string;
|
||||
translateToString(trimRight?: boolean, startCol?: number, endCol?: number, outColumns?: number[]): string;
|
||||
|
||||
/* direct access to cell attrs */
|
||||
getWidth(index: number): number;
|
||||
|
||||
@@ -126,6 +126,9 @@ export class AttributeData implements IAttributeData {
|
||||
? (this.bg & BgFlags.HAS_EXTENDED ? this.extended.underlineStyle : UnderlineStyle.SINGLE)
|
||||
: UnderlineStyle.NONE;
|
||||
}
|
||||
public getUnderlineVariantOffset(): number {
|
||||
return this.extended.underlineVariantOffset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,6 +177,18 @@ export class ExtendedAttrs implements IExtendedAttrs {
|
||||
this._urlId = value;
|
||||
}
|
||||
|
||||
public get underlineVariantOffset(): number {
|
||||
const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;
|
||||
if (val < 0) {
|
||||
return val ^ 0xFFFFFFF8;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
public set underlineVariantOffset(value: number) {
|
||||
this._ext &= ~ExtFlags.VARIANT_OFFSET;
|
||||
this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;
|
||||
}
|
||||
|
||||
constructor(
|
||||
ext: number = 0,
|
||||
urlId: number = 0
|
||||
|
||||
@@ -119,6 +119,18 @@ describe('AttributeData', () => {
|
||||
attrs.fg &= ~FgFlags.UNDERLINE;
|
||||
assert.equal(attrs.getUnderlineStyle(), UnderlineStyle.NONE);
|
||||
});
|
||||
it('getUnderlineVariantOffset', () => {
|
||||
const attrs = new AttributeData();
|
||||
|
||||
// defaults to no offset
|
||||
assert.equal(attrs.getUnderlineVariantOffset(), 0);
|
||||
|
||||
// should return 0 - 7
|
||||
for (let i = 0; i < 8; ++i) {
|
||||
attrs.extended.underlineVariantOffset = i;
|
||||
assert.equal(attrs.getUnderlineVariantOffset(), i);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -331,56 +343,75 @@ describe('BufferLine', function(): void {
|
||||
describe('translateToString with and w\'o trimming', function(): void {
|
||||
it('empty line', function(): void {
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
assert.equal(line.translateToString(false), ' ');
|
||||
assert.equal(line.translateToString(true), '');
|
||||
const columns: number[] = [];
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), ' ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), '');
|
||||
assert.deepEqual(columns, [0]);
|
||||
});
|
||||
it('ASCII', function(): void {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(2, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(4, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(5, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
assert.equal(line.translateToString(false), 'a a aa ');
|
||||
assert.equal(line.translateToString(true), 'a a aa');
|
||||
assert.equal(line.translateToString(false, 0, 5), 'a a a');
|
||||
assert.equal(line.translateToString(false, 0, 4), 'a a ');
|
||||
assert.equal(line.translateToString(false, 0, 3), 'a a');
|
||||
assert.equal(line.translateToString(true, 0, 5), 'a a a');
|
||||
assert.equal(line.translateToString(true, 0, 4), 'a a ');
|
||||
assert.equal(line.translateToString(true, 0, 3), 'a a');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), 'a a aa ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), 'a a aa');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6]);
|
||||
for (const trimRight of [true, false]) {
|
||||
assert.equal(line.translateToString(trimRight, 0, 5, columns), 'a a a');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 4, columns), 'a a ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 3, columns), 'a a');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3]);
|
||||
}
|
||||
|
||||
});
|
||||
it('surrogate', function(): void {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(2, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
|
||||
line.setCell(4, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
|
||||
line.setCell(5, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
|
||||
assert.equal(line.translateToString(false), 'a 𝄞 𝄞𝄞 ');
|
||||
assert.equal(line.translateToString(true), 'a 𝄞 𝄞𝄞');
|
||||
assert.equal(line.translateToString(false, 0, 5), 'a 𝄞 𝄞');
|
||||
assert.equal(line.translateToString(false, 0, 4), 'a 𝄞 ');
|
||||
assert.equal(line.translateToString(false, 0, 3), 'a 𝄞');
|
||||
assert.equal(line.translateToString(true, 0, 5), 'a 𝄞 𝄞');
|
||||
assert.equal(line.translateToString(true, 0, 4), 'a 𝄞 ');
|
||||
assert.equal(line.translateToString(true, 0, 3), 'a 𝄞');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), 'a 𝄞 𝄞𝄞 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), 'a 𝄞 𝄞𝄞');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5, 5, 6]);
|
||||
for (const trimRight of [true, false]) {
|
||||
assert.equal(line.translateToString(trimRight, 0, 5, columns), 'a 𝄞 𝄞');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 4, columns), 'a 𝄞 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 3, columns), 'a 𝄞');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3]);
|
||||
}
|
||||
});
|
||||
it('combining', function(): void {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(2, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
|
||||
line.setCell(4, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
|
||||
line.setCell(5, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
|
||||
assert.equal(line.translateToString(false), 'a e\u0301 e\u0301e\u0301 ');
|
||||
assert.equal(line.translateToString(true), 'a e\u0301 e\u0301e\u0301');
|
||||
assert.equal(line.translateToString(false, 0, 5), 'a e\u0301 e\u0301');
|
||||
assert.equal(line.translateToString(false, 0, 4), 'a e\u0301 ');
|
||||
assert.equal(line.translateToString(false, 0, 3), 'a e\u0301');
|
||||
assert.equal(line.translateToString(true, 0, 5), 'a e\u0301 e\u0301');
|
||||
assert.equal(line.translateToString(true, 0, 4), 'a e\u0301 ');
|
||||
assert.equal(line.translateToString(true, 0, 3), 'a e\u0301');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), 'a e\u0301 e\u0301e\u0301 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), 'a e\u0301 e\u0301e\u0301');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5, 5, 6]);
|
||||
for (const trimRight of [true, false]) {
|
||||
assert.equal(line.translateToString(trimRight, 0, 5, columns), 'a e\u0301 e\u0301');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4, 4, 5]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 4, columns), 'a e\u0301 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3, 4]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 3, columns), 'a e\u0301');
|
||||
assert.deepEqual(columns, [0, 1, 2, 2, 3]);
|
||||
}
|
||||
});
|
||||
it('fullwidth', function(): void {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(2, CellData.fromCharData([1, '1', 2, '1'.charCodeAt(0)]));
|
||||
@@ -389,43 +420,55 @@ describe('BufferLine', function(): void {
|
||||
line.setCell(6, CellData.fromCharData([0, '', 0, 0]));
|
||||
line.setCell(7, CellData.fromCharData([1, '1', 2, '1'.charCodeAt(0)]));
|
||||
line.setCell(8, CellData.fromCharData([0, '', 0, 0]));
|
||||
assert.equal(line.translateToString(false), 'a 1 11 ');
|
||||
assert.equal(line.translateToString(true), 'a 1 11');
|
||||
assert.equal(line.translateToString(false, 0, 7), 'a 1 1');
|
||||
assert.equal(line.translateToString(false, 0, 6), 'a 1 1');
|
||||
assert.equal(line.translateToString(false, 0, 5), 'a 1 ');
|
||||
assert.equal(line.translateToString(false, 0, 4), 'a 1');
|
||||
assert.equal(line.translateToString(false, 0, 3), 'a 1');
|
||||
assert.equal(line.translateToString(false, 0, 2), 'a ');
|
||||
assert.equal(line.translateToString(true, 0, 7), 'a 1 1');
|
||||
assert.equal(line.translateToString(true, 0, 6), 'a 1 1');
|
||||
assert.equal(line.translateToString(true, 0, 5), 'a 1 ');
|
||||
assert.equal(line.translateToString(true, 0, 4), 'a 1');
|
||||
assert.equal(line.translateToString(true, 0, 3), 'a 1');
|
||||
assert.equal(line.translateToString(true, 0, 2), 'a ');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), 'a 1 11 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4, 5, 7, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), 'a 1 11');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4, 5, 7, 9]);
|
||||
for (const trimRight of [true, false]) {
|
||||
assert.equal(line.translateToString(trimRight, 0, 7, columns), 'a 1 1');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4, 5, 7]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 6, columns), 'a 1 1');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4, 5, 7]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 5, columns), 'a 1 ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4, 5]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 4, columns), 'a 1');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 3, columns), 'a 1');
|
||||
assert.deepEqual(columns, [0, 1, 2, 4]);
|
||||
assert.equal(line.translateToString(trimRight, 0, 2, columns), 'a ');
|
||||
assert.deepEqual(columns, [0, 1, 2]);
|
||||
}
|
||||
});
|
||||
it('space at end', function(): void {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(2, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(4, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(5, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
line.setCell(6, CellData.fromCharData([1, ' ', 1, ' '.charCodeAt(0)]));
|
||||
assert.equal(line.translateToString(false), 'a a aa ');
|
||||
assert.equal(line.translateToString(true), 'a a aa ');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), 'a a aa ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), 'a a aa ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6, 7]);
|
||||
});
|
||||
it('should always return some sane value', function(): void {
|
||||
const columns: number[] = [];
|
||||
// sanity check - broken line with invalid out of bound null width cells
|
||||
// this can atm happen with deleting/inserting chars in inputhandler by "breaking"
|
||||
// fullwidth pairs --> needs to be fixed after settling BufferLine impl
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, 0, NULL_CELL_CODE]), false);
|
||||
assert.equal(line.translateToString(false), ' ');
|
||||
assert.equal(line.translateToString(true), '');
|
||||
assert.equal(line.translateToString(false, undefined, undefined, columns), ' ');
|
||||
assert.deepEqual(columns, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
|
||||
assert.equal(line.translateToString(true, undefined, undefined, columns), '');
|
||||
assert.deepEqual(columns, [0]);
|
||||
});
|
||||
it('should work with endCol=0', () => {
|
||||
const columns: number[] = [];
|
||||
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, 0, NULL_CELL_CODE]), false);
|
||||
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
|
||||
assert.equal(line.translateToString(true, 0, 0), '');
|
||||
assert.equal(line.translateToString(true, 0, 0, columns), '');
|
||||
assert.deepEqual(columns, [0]);
|
||||
});
|
||||
});
|
||||
describe('addCharToCell', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { CharData, IAttributeData, IBufferLine, ICellData, IExtendedAttrs } from 'common/Types';
|
||||
import { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';
|
||||
import { AttributeData } from 'common/buffer/AttributeData';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
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 'common/buffer/Constants';
|
||||
import { stringFromCodePoint } from 'common/input/TextDecoder';
|
||||
@@ -212,13 +212,13 @@ export class BufferLine implements IBufferLine {
|
||||
* Since the input handler see the incoming chars as UTF32 codepoints,
|
||||
* it gets an optimized access method.
|
||||
*/
|
||||
public setCellFromCodePoint(index: number, codePoint: number, width: number, fg: number, bg: number, eAttrs: IExtendedAttrs): void {
|
||||
if (bg & BgFlags.HAS_EXTENDED) {
|
||||
this._extendedAttrs[index] = eAttrs;
|
||||
public setCellFromCodepoint(index: number, codePoint: number, width: number, attrs: IAttributeData): void {
|
||||
if (attrs.bg & BgFlags.HAS_EXTENDED) {
|
||||
this._extendedAttrs[index] = attrs.extended;
|
||||
}
|
||||
this._data[index * CELL_SIZE + Cell.CONTENT] = codePoint | (width << Content.WIDTH_SHIFT);
|
||||
this._data[index * CELL_SIZE + Cell.FG] = fg;
|
||||
this._data[index * CELL_SIZE + Cell.BG] = bg;
|
||||
this._data[index * CELL_SIZE + Cell.FG] = attrs.fg;
|
||||
this._data[index * CELL_SIZE + Cell.BG] = attrs.bg;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,12 +253,12 @@ export class BufferLine implements IBufferLine {
|
||||
this._data[index * CELL_SIZE + Cell.CONTENT] = content;
|
||||
}
|
||||
|
||||
public insertCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {
|
||||
public insertCells(pos: number, n: number, fillCellData: ICellData): void {
|
||||
pos %= this.length;
|
||||
|
||||
// handle fullwidth at pos: reset cell one to the left if pos is second cell of a wide char
|
||||
if (pos && this.getWidth(pos - 1) === 2) {
|
||||
this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(pos - 1, 0, 1, fillCellData);
|
||||
}
|
||||
|
||||
if (n < this.length - pos) {
|
||||
@@ -277,11 +277,11 @@ export class BufferLine implements IBufferLine {
|
||||
|
||||
// handle fullwidth at line end: reset last cell if it is first cell of a wide char
|
||||
if (this.getWidth(this.length - 1) === 2) {
|
||||
this.setCellFromCodePoint(this.length - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(this.length - 1, 0, 1, fillCellData);
|
||||
}
|
||||
}
|
||||
|
||||
public deleteCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {
|
||||
public deleteCells(pos: number, n: number, fillCellData: ICellData): void {
|
||||
pos %= this.length;
|
||||
if (n < this.length - pos) {
|
||||
const cell = new CellData();
|
||||
@@ -301,21 +301,21 @@ export class BufferLine implements IBufferLine {
|
||||
// - reset pos-1 if wide char
|
||||
// - reset pos if width==0 (previous second cell of a wide char)
|
||||
if (pos && this.getWidth(pos - 1) === 2) {
|
||||
this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(pos - 1, 0, 1, fillCellData);
|
||||
}
|
||||
if (this.getWidth(pos) === 0 && !this.hasContent(pos)) {
|
||||
this.setCellFromCodePoint(pos, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(pos, 0, 1, fillCellData);
|
||||
}
|
||||
}
|
||||
|
||||
public replaceCells(start: number, end: number, fillCellData: ICellData, eraseAttr?: IAttributeData, respectProtect: boolean = false): void {
|
||||
public replaceCells(start: number, end: number, fillCellData: ICellData, respectProtect: boolean = false): void {
|
||||
// full branching on respectProtect==true, hopefully getting fast JIT for standard case
|
||||
if (respectProtect) {
|
||||
if (start && this.getWidth(start - 1) === 2 && !this.isProtected(start - 1)) {
|
||||
this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(start - 1, 0, 1, fillCellData);
|
||||
}
|
||||
if (end < this.length && this.getWidth(end - 1) === 2 && !this.isProtected(end)) {
|
||||
this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
||||
}
|
||||
while (start < end && start < this.length) {
|
||||
if (!this.isProtected(start)) {
|
||||
@@ -328,11 +328,11 @@ export class BufferLine implements IBufferLine {
|
||||
|
||||
// handle fullwidth at start: reset cell one to the left if start is second cell of a wide char
|
||||
if (start && this.getWidth(start - 1) === 2) {
|
||||
this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(start - 1, 0, 1, fillCellData);
|
||||
}
|
||||
// handle fullwidth at last cell + 1: reset to empty cell if it is second part of a wide char
|
||||
if (end < this.length && this.getWidth(end - 1) === 2) {
|
||||
this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());
|
||||
this.setCellFromCodepoint(end, 0, 1, fillCellData);
|
||||
}
|
||||
|
||||
while (start < end && start < this.length) {
|
||||
@@ -508,16 +508,43 @@ export class BufferLine implements IBufferLine {
|
||||
}
|
||||
}
|
||||
|
||||
public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = this.length): string {
|
||||
/**
|
||||
* Translates the buffer line to a string.
|
||||
*
|
||||
* @param trimRight Whether to trim any empty cells on the right.
|
||||
* @param startCol The column to start the string (0-based inclusive).
|
||||
* @param endCol The column to end the string (0-based exclusive).
|
||||
* @param outColumns if specified, this array will be filled with column numbers such that
|
||||
* `returnedString[i]` is displayed at `outColumns[i]` column. `outColumns[returnedString.length]`
|
||||
* is where the character following `returnedString` will be displayed.
|
||||
*
|
||||
* When a single cell is translated to multiple UTF-16 code units (e.g. surrogate pair) in the
|
||||
* returned string, the corresponding entries in `outColumns` will have the same column number.
|
||||
*/
|
||||
public translateToString(trimRight?: boolean, startCol?: number, endCol?: number, outColumns?: number[]): string {
|
||||
startCol = startCol ?? 0;
|
||||
endCol = endCol ?? this.length;
|
||||
if (trimRight) {
|
||||
endCol = Math.min(endCol, this.getTrimmedLength());
|
||||
}
|
||||
if (outColumns) {
|
||||
outColumns.length = 0;
|
||||
}
|
||||
let result = '';
|
||||
while (startCol < endCol) {
|
||||
const content = this._data[startCol * CELL_SIZE + Cell.CONTENT];
|
||||
const cp = content & Content.CODEPOINT_MASK;
|
||||
result += (content & Content.IS_COMBINED_MASK) ? this._combined[startCol] : (cp) ? stringFromCodePoint(cp) : WHITESPACE_CELL_CHAR;
|
||||
startCol += (content >> Content.WIDTH_SHIFT) || 1; // always advance by 1
|
||||
const chars = (content & Content.IS_COMBINED_MASK) ? this._combined[startCol] : (cp) ? stringFromCodePoint(cp) : WHITESPACE_CELL_CHAR;
|
||||
result += chars;
|
||||
if (outColumns) {
|
||||
for (let i = 0; i < chars.length; ++i) {
|
||||
outColumns.push(startCol);
|
||||
}
|
||||
}
|
||||
startCol += (content >> Content.WIDTH_SHIFT) || 1; // always advance by at least 1
|
||||
}
|
||||
if (outColumns) {
|
||||
outColumns.push(startCol);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { getRangeLength } from 'common/buffer/BufferRange';
|
||||
import { IBufferRange } from 'xterm';
|
||||
import { IBufferRange } from '@xterm/xterm';
|
||||
|
||||
describe('BufferRange', () => {
|
||||
describe('getRangeLength', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IBufferRange } from 'xterm';
|
||||
import { IBufferRange } from '@xterm/xterm';
|
||||
|
||||
export function getRangeLength(range: IBufferRange, bufferCols: number): number {
|
||||
if (range.start.y > range.end.y) {
|
||||
|
||||
@@ -134,9 +134,17 @@ export const enum BgFlags {
|
||||
|
||||
export const enum ExtFlags {
|
||||
/**
|
||||
* bit 27..32 (upper 3 unused)
|
||||
* bit 27..29
|
||||
*/
|
||||
UNDERLINE_STYLE = 0x1C000000
|
||||
UNDERLINE_STYLE = 0x1C000000,
|
||||
|
||||
/**
|
||||
* bit 30..32
|
||||
*
|
||||
* An optional variant for the glyph, this can be used for example to offset underlines by a
|
||||
* number of pixels to create a perfect pattern.
|
||||
*/
|
||||
VARIANT_OFFSET = 0xE0000000
|
||||
}
|
||||
|
||||
export const enum UnderlineStyle {
|
||||
|
||||
@@ -106,6 +106,21 @@ describe('Keyboard', () => {
|
||||
it('should return \\x1b[5B for ctrl+down', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ ctrlKey: true, keyCode: 40 }).key, '\x1b[1;5B'); // CSI 5 B
|
||||
});
|
||||
it('should return \\x08 for ctrl+backspace', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ ctrlKey: true, keyCode: 8 }).key, '\x08');
|
||||
});
|
||||
it('should return \\x1b\\x7f for alt+backspace', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ altKey: true, keyCode: 8 }).key, '\x1b\x7f');
|
||||
});
|
||||
it('should return \\x1b\\x08 for ctrl+alt+backspace', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ ctrlKey: true, altKey: true, keyCode: 8 }).key, '\x1b\x08');
|
||||
});
|
||||
it('should return \\x1b[3;2~ for shift+delete', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ shiftKey: true, keyCode: 46 }).key, '\x1b[3;2~');
|
||||
});
|
||||
it('should return \\x1b[3;3~ for alt+delete', () => {
|
||||
assert.equal(testEvaluateKeyboardEvent({ altKey: true, keyCode: 46 }).key, '\x1b[3;3~');
|
||||
});
|
||||
|
||||
describe('On non-macOS platforms', () => {
|
||||
// Evalueate alt + arrow key movement, which is a feature of terminal emulators but not VT100
|
||||
|
||||
@@ -83,11 +83,10 @@ export function evaluateKeyboardEvent(
|
||||
break;
|
||||
case 8:
|
||||
// backspace
|
||||
result.key = ev.ctrlKey ? '\b' : C0.DEL; // ^H or ^?
|
||||
if (ev.altKey) {
|
||||
result.key = C0.ESC + C0.DEL; // \e ^?
|
||||
break;
|
||||
result.key = C0.ESC + result.key;
|
||||
}
|
||||
result.key = C0.DEL; // ^?
|
||||
break;
|
||||
case 9:
|
||||
// tab
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { AddonManager, ILoadedAddon } from './AddonManager';
|
||||
import { ITerminalAddon } from 'xterm';
|
||||
import { ITerminalAddon } from '@xterm/xterm';
|
||||
|
||||
class TestAddonManager extends AddonManager {
|
||||
public get addons(): ILoadedAddon[] {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { ITerminalAddon, IDisposable, Terminal } from 'xterm';
|
||||
import { ITerminalAddon, IDisposable, Terminal } from '@xterm/xterm';
|
||||
|
||||
export interface ILoadedAddon {
|
||||
instance: ITerminalAddon;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';
|
||||
import { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from '@xterm/xterm';
|
||||
import { IBuffer } from 'common/buffer/Types';
|
||||
import { BufferLineApiView } from 'common/public/BufferLineApiView';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { IBufferLine, ICellData } from 'common/Types';
|
||||
import { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from 'xterm';
|
||||
import { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from '@xterm/xterm';
|
||||
|
||||
export class BufferLineApiView implements IBufferLineApi {
|
||||
constructor(private _line: IBufferLine) { }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from 'xterm';
|
||||
import { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from '@xterm/xterm';
|
||||
import { BufferApiView } from 'common/public/BufferApiView';
|
||||
import { EventEmitter } from 'common/EventEmitter';
|
||||
import { ICoreTerminal } from 'common/Types';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { IParams } from 'common/parser/Types';
|
||||
import { IDisposable, IFunctionIdentifier, IParser } from 'xterm';
|
||||
import { IDisposable, IFunctionIdentifier, IParser } from '@xterm/xterm';
|
||||
import { ICoreTerminal } from 'common/Types';
|
||||
|
||||
export class ParserApi implements IParser {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { ICoreTerminal } from 'common/Types';
|
||||
import { IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';
|
||||
import { IUnicodeHandling, IUnicodeVersionProvider } from '@xterm/xterm';
|
||||
|
||||
export class UnicodeApi implements IUnicodeHandling {
|
||||
constructor(private _core: ICoreTerminal) { }
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { IDecorationService, IInternalDecoration } from 'common/services/Services';
|
||||
import { SortedList } from 'common/SortedList';
|
||||
import { IColor } from 'common/Types';
|
||||
import { IDecoration, IDecorationOptions, IMarker } from 'xterm';
|
||||
import { IDecoration, IDecorationOptions, IMarker } from '@xterm/xterm';
|
||||
|
||||
// Work variables to avoid garbage collection
|
||||
let $xmin = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IEvent, IEventEmitter } from 'common/EventEmitter';
|
||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||
import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColor, CursorStyle, CursorInactiveStyle, IOscLinkData } from 'common/Types';
|
||||
import { createDecorator } from 'common/services/ServiceRegistry';
|
||||
import { IDecorationOptions, IDecoration, ILinkHandler, IWindowsPty, ILogger } from 'xterm';
|
||||
import { IDecorationOptions, IDecoration, ILinkHandler, IWindowsPty, ILogger } from '@xterm/xterm';
|
||||
|
||||
export const IBufferService = createDecorator<IBufferService>('BufferService');
|
||||
export interface IBufferService {
|
||||
|
||||
Reference in New Issue
Block a user