Merge branch 'master' into request_mode
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2015"
|
"es2015"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { BaseCharAtlas } from './BaseCharAtlas';
|
|||||||
import { DynamicCharAtlas } from './DynamicCharAtlas';
|
import { DynamicCharAtlas } from './DynamicCharAtlas';
|
||||||
import { ICharAtlasConfig } from './Types';
|
import { ICharAtlasConfig } from './Types';
|
||||||
import { IColorSet } from 'browser/Types';
|
import { IColorSet } from 'browser/Types';
|
||||||
import { ITerminalOptions } from 'common/services/Services';
|
import { ITerminalOptions } from 'xterm';
|
||||||
|
|
||||||
interface ICharAtlasCacheEntry {
|
interface ICharAtlasCacheEntry {
|
||||||
atlas: BaseCharAtlas;
|
atlas: BaseCharAtlas;
|
||||||
@@ -25,7 +25,7 @@ const charAtlasCache: ICharAtlasCacheEntry[] = [];
|
|||||||
* one that is in use by another terminal.
|
* one that is in use by another terminal.
|
||||||
*/
|
*/
|
||||||
export function acquireCharAtlas(
|
export function acquireCharAtlas(
|
||||||
options: ITerminalOptions,
|
options: Required<ITerminalOptions>,
|
||||||
rendererId: number,
|
rendererId: number,
|
||||||
colors: IColorSet,
|
colors: IColorSet,
|
||||||
scaledCharWidth: number,
|
scaledCharWidth: number,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
import { ICharAtlasConfig } from './Types';
|
import { ICharAtlasConfig } from './Types';
|
||||||
import { DEFAULT_COLOR } from 'common/buffer/Constants';
|
import { DEFAULT_COLOR } from 'common/buffer/Constants';
|
||||||
import { IColorSet, IPartialColorSet } from 'browser/Types';
|
import { IColorSet, IPartialColorSet } from 'browser/Types';
|
||||||
import { ITerminalOptions } from 'common/services/Services';
|
import { ITerminalOptions } from 'xterm';
|
||||||
|
|
||||||
export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, options: ITerminalOptions, colors: IColorSet): ICharAtlasConfig {
|
export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, options: Required<ITerminalOptions>, colors: IColorSet): ICharAtlasConfig {
|
||||||
// null out some fields that don't matter
|
// null out some fields that don't matter
|
||||||
const clonedColors: IPartialColorSet = {
|
const clonedColors: IPartialColorSet = {
|
||||||
foreground: colors.foreground,
|
foreground: colors.foreground,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es6"
|
"es6"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2015"
|
"es2015"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es6",
|
"es6",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6",
|
"es6",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2015"
|
"es2015"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2015"
|
"es2015"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2015"
|
"es2015"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -622,18 +622,18 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|||||||
// Calculate the scaled cell height, if lineHeight is _not_ 1, the resulting value will be
|
// Calculate the scaled cell height, if lineHeight is _not_ 1, the resulting value will be
|
||||||
// floored since lineHeight can never be lower then 1, this guarentees the scaled cell height
|
// floored since lineHeight can never be lower then 1, this guarentees the scaled cell height
|
||||||
// will always be larger than scaled char height.
|
// will always be larger than scaled char height.
|
||||||
this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._terminal.options.lineHeight!);
|
this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._terminal.options.lineHeight);
|
||||||
|
|
||||||
// Calculate the y offset within a cell that glyph should draw at in order for it to be centered
|
// Calculate the y offset within a cell that glyph should draw at in order for it to be centered
|
||||||
// correctly within the cell.
|
// correctly within the cell.
|
||||||
this.dimensions.scaledCharTop = this._terminal.options.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);
|
this.dimensions.scaledCharTop = this._terminal.options.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);
|
||||||
|
|
||||||
// Calculate the scaled cell width, taking the letterSpacing into account.
|
// Calculate the scaled cell width, taking the letterSpacing into account.
|
||||||
this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._terminal.options.letterSpacing!);
|
this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._terminal.options.letterSpacing);
|
||||||
|
|
||||||
// Calculate the x offset with a cell that text should draw from in order for it to be centered
|
// Calculate the x offset with a cell that text should draw from in order for it to be centered
|
||||||
// correctly within the cell.
|
// correctly within the cell.
|
||||||
this.dimensions.scaledCharLeft = Math.floor(this._terminal.options.letterSpacing! / 2);
|
this.dimensions.scaledCharLeft = Math.floor(this._terminal.options.letterSpacing / 2);
|
||||||
|
|
||||||
// Recalculate the canvas dimensions, the scaled dimensions define the actual number of pixel in
|
// Recalculate the canvas dimensions, the scaled dimensions define the actual number of pixel in
|
||||||
// the canvas
|
// the canvas
|
||||||
|
|||||||
@@ -32,21 +32,21 @@ export function generateConfig(scaledCellWidth: number, scaledCellHeight: number
|
|||||||
contrastCache: colors.contrastCache
|
contrastCache: colors.contrastCache
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
customGlyphs: terminal.options.customGlyphs!,
|
customGlyphs: terminal.options.customGlyphs,
|
||||||
devicePixelRatio: window.devicePixelRatio,
|
devicePixelRatio: window.devicePixelRatio,
|
||||||
letterSpacing: terminal.options.letterSpacing!,
|
letterSpacing: terminal.options.letterSpacing,
|
||||||
lineHeight: terminal.options.lineHeight!,
|
lineHeight: terminal.options.lineHeight,
|
||||||
scaledCellWidth,
|
scaledCellWidth,
|
||||||
scaledCellHeight,
|
scaledCellHeight,
|
||||||
scaledCharWidth,
|
scaledCharWidth,
|
||||||
scaledCharHeight,
|
scaledCharHeight,
|
||||||
fontFamily: terminal.options.fontFamily!,
|
fontFamily: terminal.options.fontFamily,
|
||||||
fontSize: terminal.options.fontSize!,
|
fontSize: terminal.options.fontSize,
|
||||||
fontWeight: terminal.options.fontWeight as FontWeight,
|
fontWeight: terminal.options.fontWeight,
|
||||||
fontWeightBold: terminal.options.fontWeightBold as FontWeight,
|
fontWeightBold: terminal.options.fontWeightBold,
|
||||||
allowTransparency: terminal.options.allowTransparency!,
|
allowTransparency: terminal.options.allowTransparency,
|
||||||
drawBoldTextInBrightColors: terminal.options.drawBoldTextInBrightColors!,
|
drawBoldTextInBrightColors: terminal.options.drawBoldTextInBrightColors,
|
||||||
minimumContrastRatio: terminal.options.minimumContrastRatio!,
|
minimumContrastRatio: terminal.options.minimumContrastRatio,
|
||||||
colors: clonedColors
|
colors: clonedColors
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
|
|||||||
private _renderBarCursor(terminal: Terminal, x: number, y: number, cell: ICellData): void {
|
private _renderBarCursor(terminal: Terminal, x: number, y: number, cell: ICellData): void {
|
||||||
this._ctx.save();
|
this._ctx.save();
|
||||||
this._ctx.fillStyle = this._colors.cursor.css;
|
this._ctx.fillStyle = this._colors.cursor.css;
|
||||||
this._fillLeftLineAtCell(x, y, terminal.options.cursorWidth!);
|
this._fillLeftLineAtCell(x, y, terminal.options.cursorWidth);
|
||||||
this._ctx.restore();
|
this._ctx.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es6"
|
"es6"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6",
|
"es6",
|
||||||
],
|
],
|
||||||
|
|||||||
+1
-1
@@ -344,7 +344,7 @@ function initOptions(term: TerminalType): void {
|
|||||||
];
|
];
|
||||||
const stringOptions = {
|
const stringOptions = {
|
||||||
cursorStyle: ['block', 'underline', 'bar'],
|
cursorStyle: ['block', 'underline', 'bar'],
|
||||||
fastScrollModifier: ['alt', 'ctrl', 'shift', undefined],
|
fastScrollModifier: ['none', 'alt', 'ctrl', 'shift'],
|
||||||
fontFamily: null,
|
fontFamily: null,
|
||||||
fontWeight: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
fontWeight: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
||||||
fontWeightBold: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
fontWeightBold: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export class MockTerminal implements ITerminal {
|
|||||||
public renderer!: IRenderer;
|
public renderer!: IRenderer;
|
||||||
public linkifier2!: ILinkifier2;
|
public linkifier2!: ILinkifier2;
|
||||||
public isFocused!: boolean;
|
public isFocused!: boolean;
|
||||||
public options: ITerminalOptions = {};
|
public options!: Required<ITerminalOptions>;
|
||||||
public element!: HTMLElement;
|
public element!: HTMLElement;
|
||||||
public screenElement!: HTMLElement;
|
public screenElement!: HTMLElement;
|
||||||
public rowContainer!: HTMLElement;
|
public rowContainer!: HTMLElement;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ export interface ITerminal extends IPublicTerminal, ICoreTerminal {
|
|||||||
browser: IBrowser;
|
browser: IBrowser;
|
||||||
buffer: IBuffer;
|
buffer: IBuffer;
|
||||||
viewport: IViewport | undefined;
|
viewport: IViewport | undefined;
|
||||||
options: ITerminalOptions;
|
options: Required<ITerminalOptions>;
|
||||||
linkifier2: ILinkifier2;
|
linkifier2: ILinkifier2;
|
||||||
|
|
||||||
onBlur: IEvent<void>;
|
onBlur: IEvent<void>;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export class Terminal implements ITerminalApi {
|
|||||||
private _addonManager: AddonManager;
|
private _addonManager: AddonManager;
|
||||||
private _parser: IParser | undefined;
|
private _parser: IParser | undefined;
|
||||||
private _buffer: BufferNamespaceApi | undefined;
|
private _buffer: BufferNamespaceApi | undefined;
|
||||||
private _publicOptions: ITerminalOptions;
|
private _publicOptions: Required<ITerminalOptions>;
|
||||||
|
|
||||||
constructor(options?: ITerminalOptions) {
|
constructor(options?: ITerminalOptions) {
|
||||||
this._core = new TerminalCore(options);
|
this._core = new TerminalCore(options);
|
||||||
@@ -123,7 +123,7 @@ export class Terminal implements ITerminalApi {
|
|||||||
wraparoundMode: m.wraparound
|
wraparoundMode: m.wraparound
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public get options(): ITerminalOptions {
|
public get options(): Required<ITerminalOptions> {
|
||||||
return this._publicOptions;
|
return this._publicOptions;
|
||||||
}
|
}
|
||||||
public set options(options: ITerminalOptions) {
|
public set options(options: ITerminalOptions) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
|
|||||||
public get cols(): number { return this._bufferService.cols; }
|
public get cols(): number { return this._bufferService.cols; }
|
||||||
public get rows(): number { return this._bufferService.rows; }
|
public get rows(): number { return this._bufferService.rows; }
|
||||||
public get buffers(): IBufferSet { return this._bufferService.buffers; }
|
public get buffers(): IBufferSet { return this._bufferService.buffers; }
|
||||||
public get options(): ITerminalOptions { return this.optionsService.options; }
|
public get options(): Required<ITerminalOptions> { return this.optionsService.options; }
|
||||||
public set options(options: ITerminalOptions) {
|
public set options(options: ITerminalOptions) {
|
||||||
for (const key in options) {
|
for (const key in options) {
|
||||||
this.optionsService.options[key] = options[key];
|
this.optionsService.options[key] = options[key];
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ export class MockLogService implements ILogService {
|
|||||||
|
|
||||||
export class MockOptionsService implements IOptionsService {
|
export class MockOptionsService implements IOptionsService {
|
||||||
public serviceBrand: any;
|
public serviceBrand: any;
|
||||||
public readonly rawOptions: ITerminalOptions = clone(DEFAULT_OPTIONS);
|
public readonly rawOptions: Required<ITerminalOptions> = clone(DEFAULT_OPTIONS);
|
||||||
public options: ITerminalOptions = this.rawOptions;
|
public options: Required<ITerminalOptions> = this.rawOptions;
|
||||||
public onOptionChange: IEvent<string> = new EventEmitter<string>().event;
|
public onOptionChange: IEvent<string> = new EventEmitter<string>().event;
|
||||||
constructor(testOptions?: Partial<ITerminalOptions>) {
|
constructor(testOptions?: Partial<ITerminalOptions>) {
|
||||||
if (testOptions) {
|
if (testOptions) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { EventEmitter, IEvent } from 'common/EventEmitter';
|
|||||||
import { isMac } from 'common/Platform';
|
import { isMac } from 'common/Platform';
|
||||||
import { CursorStyle } from 'common/Types';
|
import { CursorStyle } from 'common/Types';
|
||||||
|
|
||||||
export const DEFAULT_OPTIONS: Readonly<ITerminalOptions> = {
|
export const DEFAULT_OPTIONS: Readonly<Required<ITerminalOptions>> = {
|
||||||
cols: 80,
|
cols: 80,
|
||||||
rows: 24,
|
rows: 24,
|
||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
@@ -46,7 +46,7 @@ export const DEFAULT_OPTIONS: Readonly<ITerminalOptions> = {
|
|||||||
convertEol: false,
|
convertEol: false,
|
||||||
termName: 'xterm',
|
termName: 'xterm',
|
||||||
cancelEvents: false,
|
cancelEvents: false,
|
||||||
overviewRulerWidth: undefined
|
overviewRulerWidth: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
const FONT_WEIGHT_OPTIONS: Extract<FontWeight, string>[] = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];
|
const FONT_WEIGHT_OPTIONS: Extract<FontWeight, string>[] = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];
|
||||||
@@ -54,8 +54,8 @@ const FONT_WEIGHT_OPTIONS: Extract<FontWeight, string>[] = ['normal', 'bold', '1
|
|||||||
export class OptionsService implements IOptionsService {
|
export class OptionsService implements IOptionsService {
|
||||||
public serviceBrand: any;
|
public serviceBrand: any;
|
||||||
|
|
||||||
public readonly rawOptions: ITerminalOptions;
|
public readonly rawOptions: Required<ITerminalOptions>;
|
||||||
public options: ITerminalOptions;
|
public options: Required<ITerminalOptions>;
|
||||||
|
|
||||||
private _onOptionChange = new EventEmitter<string>();
|
private _onOptionChange = new EventEmitter<string>();
|
||||||
public get onOptionChange(): IEvent<string> { return this._onOptionChange.event; }
|
public get onOptionChange(): IEvent<string> { return this._onOptionChange.event; }
|
||||||
|
|||||||
@@ -194,8 +194,8 @@ export interface IOptionsService {
|
|||||||
* single options without any validation as we trust TypeScript to enforce correct usage
|
* single options without any validation as we trust TypeScript to enforce correct usage
|
||||||
* internally.
|
* internally.
|
||||||
*/
|
*/
|
||||||
readonly rawOptions: Readonly<ITerminalOptions>;
|
readonly rawOptions: Required<ITerminalOptions>;
|
||||||
readonly options: ITerminalOptions;
|
readonly options: Required<ITerminalOptions>;
|
||||||
|
|
||||||
readonly onOptionChange: IEvent<string>;
|
readonly onOptionChange: IEvent<string>;
|
||||||
}
|
}
|
||||||
@@ -204,41 +204,41 @@ export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '50
|
|||||||
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
||||||
|
|
||||||
export interface ITerminalOptions {
|
export interface ITerminalOptions {
|
||||||
allowProposedApi: boolean;
|
allowProposedApi?: boolean;
|
||||||
allowTransparency: boolean;
|
allowTransparency?: boolean;
|
||||||
altClickMovesCursor: boolean;
|
altClickMovesCursor?: boolean;
|
||||||
cols: number;
|
cols?: number;
|
||||||
convertEol: boolean;
|
convertEol?: boolean;
|
||||||
cursorBlink: boolean;
|
cursorBlink?: boolean;
|
||||||
cursorStyle: CursorStyle;
|
cursorStyle?: CursorStyle;
|
||||||
cursorWidth: number;
|
cursorWidth?: number;
|
||||||
customGlyphs: boolean;
|
customGlyphs?: boolean;
|
||||||
disableStdin: boolean;
|
disableStdin?: boolean;
|
||||||
drawBoldTextInBrightColors: boolean;
|
drawBoldTextInBrightColors?: boolean;
|
||||||
fastScrollModifier: 'alt' | 'ctrl' | 'shift' | undefined;
|
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
|
||||||
fastScrollSensitivity: number;
|
fastScrollSensitivity?: number;
|
||||||
fontSize: number;
|
fontSize?: number;
|
||||||
fontFamily: string;
|
fontFamily?: string;
|
||||||
fontWeight: FontWeight;
|
fontWeight?: FontWeight;
|
||||||
fontWeightBold: FontWeight;
|
fontWeightBold?: FontWeight;
|
||||||
letterSpacing: number;
|
letterSpacing?: number;
|
||||||
lineHeight: number;
|
lineHeight?: number;
|
||||||
linkHandler: ILinkHandler | null;
|
linkHandler?: ILinkHandler | null;
|
||||||
logLevel: LogLevel;
|
logLevel?: LogLevel;
|
||||||
macOptionIsMeta: boolean;
|
macOptionIsMeta?: boolean;
|
||||||
macOptionClickForcesSelection: boolean;
|
macOptionClickForcesSelection?: boolean;
|
||||||
minimumContrastRatio: number;
|
minimumContrastRatio?: number;
|
||||||
rightClickSelectsWord: boolean;
|
rightClickSelectsWord?: boolean;
|
||||||
rows: number;
|
rows?: number;
|
||||||
screenReaderMode: boolean;
|
screenReaderMode?: boolean;
|
||||||
scrollback: number;
|
scrollback?: number;
|
||||||
scrollSensitivity: number;
|
scrollSensitivity?: number;
|
||||||
smoothScrollDuration: number;
|
smoothScrollDuration?: number;
|
||||||
tabStopWidth: number;
|
tabStopWidth?: number;
|
||||||
theme: ITheme;
|
theme?: ITheme;
|
||||||
windowsMode: boolean;
|
windowsMode?: boolean;
|
||||||
windowOptions: IWindowOptions;
|
windowOptions?: IWindowOptions;
|
||||||
wordSeparator: string;
|
wordSeparator?: string;
|
||||||
overviewRulerWidth?: number;
|
overviewRulerWidth?: number;
|
||||||
|
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { IMarker, ITerminalOptions, ScrollSource } from 'common/Types';
|
|||||||
|
|
||||||
export class Terminal extends CoreTerminal {
|
export class Terminal extends CoreTerminal {
|
||||||
// TODO: We should remove options once components adopt optionsService
|
// TODO: We should remove options once components adopt optionsService
|
||||||
public get options(): IInitializedTerminalOptions { return this.optionsService.options; }
|
public get options(): Required<IInitializedTerminalOptions> { return this.optionsService.options; }
|
||||||
|
|
||||||
private _onBell = new EventEmitter<void>();
|
private _onBell = new EventEmitter<void>();
|
||||||
public get onBell(): IEvent<void> { return this._onBell.event; }
|
public get onBell(): IEvent<void> { return this._onBell.event; }
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export class Terminal implements ITerminalApi {
|
|||||||
private _addonManager: AddonManager;
|
private _addonManager: AddonManager;
|
||||||
private _parser: IParser | undefined;
|
private _parser: IParser | undefined;
|
||||||
private _buffer: BufferNamespaceApi | undefined;
|
private _buffer: BufferNamespaceApi | undefined;
|
||||||
private _publicOptions: ITerminalOptions;
|
private _publicOptions: Required<ITerminalOptions>;
|
||||||
|
|
||||||
constructor(options?: ITerminalOptions & ITerminalInitOnlyOptions) {
|
constructor(options?: ITerminalOptions & ITerminalInitOnlyOptions) {
|
||||||
this._core = new TerminalCore(options);
|
this._core = new TerminalCore(options);
|
||||||
@@ -123,7 +123,7 @@ export class Terminal implements ITerminalApi {
|
|||||||
wraparoundMode: m.wraparound
|
wraparoundMode: m.wraparound
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public get options(): ITerminalOptions {
|
public get options(): Required<ITerminalOptions> {
|
||||||
return this._publicOptions;
|
return this._publicOptions;
|
||||||
}
|
}
|
||||||
public set options(options: ITerminalOptions) {
|
public set options(options: ITerminalOptions) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"module": "commonjs",
|
||||||
"lib": [ "es5" ],
|
"target": "es2015",
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
|
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
|||||||
Vendored
+7
-2
@@ -84,7 +84,7 @@ declare module 'xterm-headless' {
|
|||||||
/**
|
/**
|
||||||
* The modifier key hold to multiply scroll speed.
|
* The modifier key hold to multiply scroll speed.
|
||||||
*/
|
*/
|
||||||
fastScrollModifier?: 'alt' | 'ctrl' | 'shift' | undefined;
|
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The spacing in whole pixels between characters.
|
* The spacing in whole pixels between characters.
|
||||||
@@ -538,6 +538,11 @@ declare module 'xterm-headless' {
|
|||||||
* ```typescript
|
* ```typescript
|
||||||
* console.log(terminal.options.fontSize);
|
* console.log(terminal.options.fontSize);
|
||||||
* ```
|
* ```
|
||||||
|
*/
|
||||||
|
get options(): Required<ITerminalOptions>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or sets the terminal options. This supports setting multiple options.
|
||||||
*
|
*
|
||||||
* @example Set a single option
|
* @example Set a single option
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -552,7 +557,7 @@ declare module 'xterm-headless' {
|
|||||||
* };
|
* };
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
options: ITerminalOptions;
|
set options(options: ITerminalOptions);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Natural language strings that can be localized.
|
* Natural language strings that can be localized.
|
||||||
|
|||||||
Vendored
+8
-3
@@ -91,7 +91,7 @@ declare module 'xterm' {
|
|||||||
/**
|
/**
|
||||||
* The modifier key hold to multiply scroll speed.
|
* The modifier key hold to multiply scroll speed.
|
||||||
*/
|
*/
|
||||||
fastScrollModifier?: 'alt' | 'ctrl' | 'shift' | undefined;
|
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The scroll speed multiplier used for fast scrolling.
|
* The scroll speed multiplier used for fast scrolling.
|
||||||
@@ -708,6 +708,11 @@ declare module 'xterm' {
|
|||||||
* ```typescript
|
* ```typescript
|
||||||
* console.log(terminal.options.fontSize);
|
* console.log(terminal.options.fontSize);
|
||||||
* ```
|
* ```
|
||||||
|
*/
|
||||||
|
get options(): Required<ITerminalOptions>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets or sets the terminal options. This supports setting multiple options.
|
||||||
*
|
*
|
||||||
* @example Set a single option
|
* @example Set a single option
|
||||||
* ```typescript
|
* ```typescript
|
||||||
@@ -722,7 +727,7 @@ declare module 'xterm' {
|
|||||||
* };
|
* };
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
options: ITerminalOptions;
|
set options(options: ITerminalOptions);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Natural language strings that can be localized.
|
* Natural language strings that can be localized.
|
||||||
@@ -1077,7 +1082,7 @@ declare module 'xterm' {
|
|||||||
/**
|
/**
|
||||||
* An object representing a range within the viewport of the terminal.
|
* An object representing a range within the viewport of the terminal.
|
||||||
*/
|
*/
|
||||||
export interface IViewportRange {
|
export interface IViewportRange {
|
||||||
/**
|
/**
|
||||||
* The start of the range.
|
* The start of the range.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user