File diff suppressed because it is too large
Load Diff
@@ -49,7 +49,6 @@ export class MockCharsetService implements ICharsetService {
|
||||
public serviceBrand: any;
|
||||
public charset: ICharset | undefined;
|
||||
public glevel: number = 0;
|
||||
public charsets: ReadonlyArray<ICharset> = [];
|
||||
public reset(): void {}
|
||||
public setgLevel(g: number): void {}
|
||||
public setgCharset(g: number, charset: ICharset): void {}
|
||||
|
||||
Vendored
+86
@@ -6,6 +6,7 @@
|
||||
import { ITerminalOptions as IPublicTerminalOptions } from 'xterm';
|
||||
import { IEvent, IEventEmitter } from 'common/EventEmitter';
|
||||
import { IDeleteEvent, IInsertEvent } from 'common/CircularList';
|
||||
import { IParams } from 'common/parser/Types';
|
||||
|
||||
export interface IDisposable {
|
||||
dispose(): void;
|
||||
@@ -300,3 +301,88 @@ export interface IWindowOptions {
|
||||
popTitle?: boolean;
|
||||
setWinLines?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the parser and handles actions generated by the parser.
|
||||
*/
|
||||
export interface IInputHandler {
|
||||
onTitleChange: IEvent<string>;
|
||||
onRequestScroll: IEvent<IAttributeData, boolean | void>;
|
||||
|
||||
parse(data: string | Uint8Array): void;
|
||||
print(data: Uint32Array, start: number, end: number): void;
|
||||
|
||||
/** C0 BEL */ bell(): void;
|
||||
/** C0 LF */ lineFeed(): void;
|
||||
/** C0 CR */ carriageReturn(): void;
|
||||
/** C0 BS */ backspace(): void;
|
||||
/** C0 HT */ tab(): void;
|
||||
/** C0 SO */ shiftOut(): void;
|
||||
/** C0 SI */ shiftIn(): void;
|
||||
|
||||
/** CSI @ */ insertChars(params: IParams): void;
|
||||
/** CSI SP @ */ scrollLeft(params: IParams): void;
|
||||
/** CSI A */ cursorUp(params: IParams): void;
|
||||
/** CSI SP A */ scrollRight(params: IParams): void;
|
||||
/** CSI B */ cursorDown(params: IParams): void;
|
||||
/** CSI C */ cursorForward(params: IParams): void;
|
||||
/** CSI D */ cursorBackward(params: IParams): void;
|
||||
/** CSI E */ cursorNextLine(params: IParams): void;
|
||||
/** CSI F */ cursorPrecedingLine(params: IParams): void;
|
||||
/** CSI G */ cursorCharAbsolute(params: IParams): void;
|
||||
/** CSI H */ cursorPosition(params: IParams): void;
|
||||
/** CSI I */ cursorForwardTab(params: IParams): void;
|
||||
/** CSI J */ eraseInDisplay(params: IParams): void;
|
||||
/** CSI K */ eraseInLine(params: IParams): void;
|
||||
/** CSI L */ insertLines(params: IParams): void;
|
||||
/** CSI M */ deleteLines(params: IParams): void;
|
||||
/** CSI P */ deleteChars(params: IParams): void;
|
||||
/** CSI S */ scrollUp(params: IParams): void;
|
||||
/** CSI T */ scrollDown(params: IParams, collect?: string): void;
|
||||
/** CSI X */ eraseChars(params: IParams): void;
|
||||
/** CSI Z */ cursorBackwardTab(params: IParams): void;
|
||||
/** CSI ` */ charPosAbsolute(params: IParams): void;
|
||||
/** CSI a */ hPositionRelative(params: IParams): void;
|
||||
/** CSI b */ repeatPrecedingCharacter(params: IParams): void;
|
||||
/** CSI c */ sendDeviceAttributesPrimary(params: IParams): void;
|
||||
/** CSI > c */ sendDeviceAttributesSecondary(params: IParams): void;
|
||||
/** CSI d */ linePosAbsolute(params: IParams): void;
|
||||
/** CSI e */ vPositionRelative(params: IParams): void;
|
||||
/** CSI f */ hVPosition(params: IParams): void;
|
||||
/** CSI g */ tabClear(params: IParams): void;
|
||||
/** CSI h */ setMode(params: IParams, collect?: string): void;
|
||||
/** CSI l */ resetMode(params: IParams, collect?: string): void;
|
||||
/** CSI m */ charAttributes(params: IParams): void;
|
||||
/** CSI n */ deviceStatus(params: IParams, collect?: string): void;
|
||||
/** CSI p */ softReset(params: IParams, collect?: string): void;
|
||||
/** CSI q */ setCursorStyle(params: IParams, collect?: string): void;
|
||||
/** CSI r */ setScrollRegion(params: IParams, collect?: string): void;
|
||||
/** CSI s */ saveCursor(params: IParams): void;
|
||||
/** CSI u */ restoreCursor(params: IParams): void;
|
||||
/** CSI ' } */ insertColumns(params: IParams): void;
|
||||
/** CSI ' ~ */ deleteColumns(params: IParams): void;
|
||||
/** OSC 0
|
||||
OSC 2 */ setTitle(data: string): void;
|
||||
/** ESC E */ nextLine(): void;
|
||||
/** ESC = */ keypadApplicationMode(): void;
|
||||
/** ESC > */ keypadNumericMode(): void;
|
||||
/** ESC % G
|
||||
ESC % @ */ selectDefaultCharset(): void;
|
||||
/** ESC ( C
|
||||
ESC ) C
|
||||
ESC * C
|
||||
ESC + C
|
||||
ESC - C
|
||||
ESC . C
|
||||
ESC / C */ selectCharset(collectAndFlag: string): void;
|
||||
/** ESC D */ index(): void;
|
||||
/** ESC H */ tabSet(): void;
|
||||
/** ESC M */ reverseIndex(): void;
|
||||
/** ESC c */ fullReset(): void;
|
||||
/** ESC n
|
||||
ESC o
|
||||
ESC |
|
||||
ESC }
|
||||
ESC ~ */ setgLevel(level: number): void;
|
||||
/** ESC # 8 */ screenAlignmentPattern(): void;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export class Buffer implements IBuffer {
|
||||
public savedY: number = 0;
|
||||
public savedX: number = 0;
|
||||
public savedCurAttrData = DEFAULT_ATTR_DATA.clone();
|
||||
public savedCharset: ICharset | null = DEFAULT_CHARSET;
|
||||
public savedCharset: ICharset | undefined = DEFAULT_CHARSET;
|
||||
public markers: Marker[] = [];
|
||||
private _nullCell: ICellData = CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
|
||||
private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]);
|
||||
|
||||
Vendored
+1
-1
@@ -31,7 +31,7 @@ export interface IBuffer {
|
||||
hasScrollback: boolean;
|
||||
savedY: number;
|
||||
savedX: number;
|
||||
savedCharset: ICharset | null;
|
||||
savedCharset: ICharset | undefined;
|
||||
savedCurAttrData: IAttributeData;
|
||||
isCursorInViewport: boolean;
|
||||
markers: IMarker[];
|
||||
|
||||
@@ -10,12 +10,12 @@ import { ICharset } from 'common/Types';
|
||||
* to be represented within the terminal with only 8-bit encoding. See ISO 2022
|
||||
* for a discussion on character sets. Only VT100 character sets are supported.
|
||||
*/
|
||||
export const CHARSETS: { [key: string]: ICharset | null } = {};
|
||||
export const CHARSETS: { [key: string]: ICharset | undefined } = {};
|
||||
|
||||
/**
|
||||
* The default character set, US.
|
||||
*/
|
||||
export const DEFAULT_CHARSET: ICharset | null = CHARSETS['B'];
|
||||
export const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];
|
||||
|
||||
/**
|
||||
* DEC Special Character and Line Drawing Set.
|
||||
@@ -74,7 +74,7 @@ CHARSETS['A'] = {
|
||||
* United States character set
|
||||
* ESC (B
|
||||
*/
|
||||
CHARSETS['B'] = null;
|
||||
CHARSETS['B'] = undefined;
|
||||
|
||||
/**
|
||||
* Dutch character set
|
||||
|
||||
@@ -10,22 +10,23 @@ export class CharsetService implements ICharsetService {
|
||||
public serviceBrand: any;
|
||||
|
||||
public charset: ICharset | undefined;
|
||||
public charsets: ICharset[] = [];
|
||||
public glevel: number = 0;
|
||||
|
||||
private _charsets: (ICharset | undefined)[] = [];
|
||||
|
||||
public reset(): void {
|
||||
this.charset = undefined;
|
||||
this.charsets = [];
|
||||
this._charsets = [];
|
||||
this.glevel = 0;
|
||||
}
|
||||
|
||||
public setgLevel(g: number): void {
|
||||
this.glevel = g;
|
||||
this.charset = this.charsets[g];
|
||||
this.charset = this._charsets[g];
|
||||
}
|
||||
|
||||
public setgCharset(g: number, charset: ICharset): void {
|
||||
this.charsets[g] = charset;
|
||||
public setgCharset(g: number, charset: ICharset | undefined): void {
|
||||
this._charsets[g] = charset;
|
||||
if (this.glevel === g) {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,6 @@ export interface ICharsetService {
|
||||
|
||||
charset: ICharset | undefined;
|
||||
readonly glevel: number;
|
||||
readonly charsets: ReadonlyArray<ICharset>;
|
||||
|
||||
reset(): void;
|
||||
|
||||
@@ -113,7 +112,7 @@ export interface ICharsetService {
|
||||
* @param g
|
||||
* @param charset
|
||||
*/
|
||||
setgCharset(g: number, charset: ICharset): void;
|
||||
setgCharset(g: number, charset: ICharset | undefined): void;
|
||||
}
|
||||
|
||||
export const IDirtyRowService = createDecorator<IDirtyRowService>('DirtyRowService');
|
||||
|
||||
Reference in New Issue
Block a user