Class: Terminal

Hierarchy

  • Terminal

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Terminal(options?: ITerminalOptions): Terminal

Defined in xterm.d.ts:641

Parameters:

Name Type Description
options? ITerminalOptions An object containing a set of options.

Returns: Terminal

Properties

buffer

buffer: IBufferNamespace

Defined in xterm.d.ts:613


cols

cols: number

Defined in xterm.d.ts:606


element

element: *HTMLElement undefined*

Defined in xterm.d.ts:587


markers

markers: ReadonlyArray‹IMarker

Defined in xterm.d.ts:619


modes

modes: IModes

Defined in xterm.d.ts:636


onBell

onBell: IEvent‹void›

Defined in xterm.d.ts:654


onBinary

onBinary: IEvent‹string›

Defined in xterm.d.ts:665


onCursorMove

onCursorMove: IEvent‹void›

Defined in xterm.d.ts:671


onData

onData: IEvent‹string›

Defined in xterm.d.ts:680


onKey

onKey: IEvent‹object›

Defined in xterm.d.ts:688


onLineFeed

onLineFeed: IEvent‹void›

Defined in xterm.d.ts:694


onRender

onRender: IEvent‹object›

Defined in xterm.d.ts:702


onResize

onResize: IEvent‹object›

Defined in xterm.d.ts:709


onScroll

onScroll: IEvent‹number›

Defined in xterm.d.ts:716


onSelectionChange

onSelectionChange: IEvent‹void›

Defined in xterm.d.ts:722


onTitleChange

onTitleChange: IEvent‹string›

Defined in xterm.d.ts:729


parser

parser: IParser

Defined in xterm.d.ts:625


rows

rows: number

Defined in xterm.d.ts:599


textarea

textarea: *HTMLTextAreaElement undefined*

Defined in xterm.d.ts:592


unicode

unicode: IUnicodeHandling

Defined in xterm.d.ts:631


Static strings

strings: ILocalizableStrings

Defined in xterm.d.ts:641

Methods

addMarker

addMarker(cursorYOffset: number): *IMarker undefined*

Defined in xterm.d.ts:848

Parameters:

Name Type
cursorYOffset number
Returns: *IMarker undefined*

attachCustomKeyEventHandler

attachCustomKeyEventHandler(customKeyEventHandler: function): void

Defined in xterm.d.ts:767

Parameters:

customKeyEventHandler: function

▸ (event: KeyboardEvent): boolean

Parameters:

Name Type
event KeyboardEvent

Returns: void


blur

blur(): void

Defined in xterm.d.ts:734

Returns: void


clear

clear(): void

Defined in xterm.d.ts:928

Returns: void


clearSelection

clearSelection(): void

Defined in xterm.d.ts:869

Returns: void


deregisterCharacterJoiner

deregisterCharacterJoiner(joinerId: number): void

Defined in xterm.d.ts:835

Parameters:

Name Type Description
joinerId number The character joiner’s ID (returned after register)

Returns: void


deregisterLinkMatcher

deregisterLinkMatcher(matcherId: number): void

Defined in xterm.d.ts:789

Parameters:

Name Type Description
matcherId number The link matcher’s ID (returned after register)

Returns: void


dispose

dispose(): void

Implementation of IDisposable

Defined in xterm.d.ts:895

Returns: void


focus

focus(): void

Defined in xterm.d.ts:739

Returns: void


getOption

getOption(key: “bellSound” “bellStyle” “cursorStyle” “fontFamily” “logLevel” “rendererType” “termName” “wordSeparator”): string

Defined in xterm.d.ts:968

Parameters:

Name Type Description
key “bellSound” | “bellStyle” | “cursorStyle” | “fontFamily” | “logLevel” | “rendererType” | “termName” | “wordSeparator” The option key.

Returns: string

getOption(key: “allowTransparency” “cancelEvents” “convertEol” “cursorBlink” “disableStdin” “macOptionIsMeta” “rightClickSelectsWord” “popOnBell” “visualBell” “windowsMode”): boolean

Defined in xterm.d.ts:973

Parameters:

Name Type Description
key “allowTransparency” | “cancelEvents” | “convertEol” | “cursorBlink” | “disableStdin” | “macOptionIsMeta” | “rightClickSelectsWord” | “popOnBell” | “visualBell” | “windowsMode” The option key.

Returns: boolean

getOption(key: “cols” “fontSize” “letterSpacing” “lineHeight” “rows” “tabStopWidth” “scrollback”): number

Defined in xterm.d.ts:978

Parameters:

Name Type Description
key “cols” | “fontSize” | “letterSpacing” | “lineHeight” | “rows” | “tabStopWidth” | “scrollback” The option key.

Returns: number

getOption(key: “fontWeight” “fontWeightBold”): FontWeight

Defined in xterm.d.ts:983

Parameters:

Name Type Description
key “fontWeight” | “fontWeightBold” The option key.

Returns: FontWeight

getOption(key: string): any

Defined in xterm.d.ts:988

Parameters:

Name Type Description
key string The option key.

Returns: any


getSelection

getSelection(): string

Defined in xterm.d.ts:859

Returns: string


getSelectionPosition

getSelectionPosition(): *ISelectionPosition undefined*

Defined in xterm.d.ts:864

Returns: *ISelectionPosition undefined*

hasSelection

hasSelection(): boolean

Defined in xterm.d.ts:853

Returns: boolean


loadAddon

loadAddon(addon: ITerminalAddon): void

Defined in xterm.d.ts:1068

Parameters:

Name Type Description
addon ITerminalAddon The addon to load.

Returns: void


open

open(parent: HTMLElement): void

Defined in xterm.d.ts:756

Parameters:

Name Type Description
parent HTMLElement The element to create the terminal within. This element must be visible (have dimensions) when open is called as several DOM- based measurements need to be performed when this function is called.

Returns: void


paste

paste(data: string): void

Defined in xterm.d.ts:962

Parameters:

Name Type Description
data string The text to write to the terminal.

Returns: void


refresh

refresh(start: number, end: number): void

Defined in xterm.d.ts:1057

Parameters:

Name Type Description
start number The row to start from (between 0 and this.rows - 1).
end number The row to end at (between start and this.rows - 1).

Returns: void


registerCharacterJoiner

registerCharacterJoiner(handler: function): number

Defined in xterm.d.ts:828

Parameters:

handler: function

▸ (text: string): [number, number][]

Parameters:

Name Type
text string

Returns: number

The ID of the new joiner, this can be used to deregister


registerLinkMatcher

registerLinkMatcher(regex: RegExp, handler: function, options?: ILinkMatcherOptions): number

Defined in xterm.d.ts:781

Parameters:

regex: RegExp

handler: function

▸ (event: MouseEvent, uri: string): void

Parameters:

Name Type
event MouseEvent
uri string

Optional options: ILinkMatcherOptions

Returns: number

The ID of the new matcher, this can be used to deregister.


registerLinkProvider

registerLinkProvider(linkProvider: ILinkProvider): IDisposable

Defined in xterm.d.ts:797

Parameters:

Name Type Description
linkProvider ILinkProvider The link provider to use to detect links.

Returns: IDisposable


registerMarker

registerMarker(cursorYOffset: number): *IMarker undefined*

Defined in xterm.d.ts:843

Parameters:

Name Type Description
cursorYOffset number The y position offset of the marker from the cursor.
Returns: *IMarker undefined*

The new marker or undefined.


reset

reset(): void

Defined in xterm.d.ts:1062

Returns: void


resize

resize(columns: number, rows: number): void

Defined in xterm.d.ts:748

Parameters:

Name Type
columns number
rows number

Returns: void


scrollLines

scrollLines(amount: number): void

Defined in xterm.d.ts:901

Parameters:

Name Type Description
amount number The number of lines to scroll down (negative scroll up).

Returns: void


scrollPages

scrollPages(pageCount: number): void

Defined in xterm.d.ts:907

Parameters:

Name Type Description
pageCount number The number of pages to scroll (negative scrolls up).

Returns: void


scrollToBottom

scrollToBottom(): void

Defined in xterm.d.ts:917

Returns: void


scrollToLine

scrollToLine(line: number): void

Defined in xterm.d.ts:923

Parameters:

Name Type Description
line number The 0-based line index to scroll to.

Returns: void


scrollToTop

scrollToTop(): void

Defined in xterm.d.ts:912

Returns: void


select

select(column: number, row: number, length: number): void

Defined in xterm.d.ts:877

Parameters:

Name Type Description
column number The column the selection starts at.
row number The row the selection starts at.
length number The length of the selection.

Returns: void


selectAll

selectAll(): void

Defined in xterm.d.ts:882

Returns: void


selectLines

selectLines(start: number, end: number): void

Defined in xterm.d.ts:889

Parameters:

Name Type Description
start number The 0-based line index to select from (inclusive).
end number The 0-based line index to select to (inclusive).

Returns: void


setOption

setOption(key: “fontFamily” “termName” “bellSound” “wordSeparator”, value: string): void

Defined in xterm.d.ts:995

Parameters:

Name Type Description
key “fontFamily” | “termName” | “bellSound” | “wordSeparator” The option key.
value string The option value.

Returns: void

setOption(key: “fontWeight” “fontWeightBold”, value: null “normal” “bold” “100” “200” “300” “400” “500” “600” “700” “800” “900” number): void

Defined in xterm.d.ts:1001

Parameters:

Name Type Description
key “fontWeight” | “fontWeightBold” The option key.
value null | “normal” | “bold” | “100” | “200” | “300” | “400” | “500” | “600” | “700” | “800” | “900” | number The option value.

Returns: void

setOption(key: “logLevel”, value: LogLevel): void

Defined in xterm.d.ts:1007

Parameters:

Name Type Description
key “logLevel” The option key.
value LogLevel The option value.

Returns: void

setOption(key: “bellStyle”, value: null “none” “visual” “sound” “both”): void

Defined in xterm.d.ts:1013

Parameters:

Name Type Description
key “bellStyle” The option key.
value null | “none” | “visual” | “sound” | “both” The option value.

Returns: void

setOption(key: “cursorStyle”, value: null “block” “underline” “bar”): void

Defined in xterm.d.ts:1019

Parameters:

Name Type Description
key “cursorStyle” The option key.
value null | “block” | “underline” | “bar” The option value.

Returns: void

setOption(key: “allowTransparency” “cancelEvents” “convertEol” “cursorBlink” “disableStdin” “macOptionIsMeta” “popOnBell” “rightClickSelectsWord” “visualBell” “windowsMode”, value: boolean): void

Defined in xterm.d.ts:1025

Parameters:

Name Type Description
key “allowTransparency” | “cancelEvents” | “convertEol” | “cursorBlink” | “disableStdin” | “macOptionIsMeta” | “popOnBell” | “rightClickSelectsWord” | “visualBell” | “windowsMode” The option key.
value boolean The option value.

Returns: void

setOption(key: “fontSize” “letterSpacing” “lineHeight” “tabStopWidth” “scrollback”, value: number): void

Defined in xterm.d.ts:1031

Parameters:

Name Type Description
key “fontSize” | “letterSpacing” | “lineHeight” | “tabStopWidth” | “scrollback” The option key.
value number The option value.

Returns: void

setOption(key: “theme”, value: ITheme): void

Defined in xterm.d.ts:1037

Parameters:

Name Type Description
key “theme” The option key.
value ITheme The option value.

Returns: void

setOption(key: “cols” “rows”, value: number): void

Defined in xterm.d.ts:1043

Parameters:

Name Type Description
key “cols” | “rows” The option key.
value number The option value.

Returns: void

setOption(key: string, value: any): void

Defined in xterm.d.ts:1049

Parameters:

Name Type Description
key string The option key.
value any The option value.

Returns: void


write

write(data: string Uint8Array, callback?: function): void

Defined in xterm.d.ts:938

Parameters:

data: *string Uint8Array*

Optional callback: function

▸ (): void

Returns: void


writeUtf8

writeUtf8(data: Uint8Array, callback?: function): void

Defined in xterm.d.ts:956

Parameters:

data: Uint8Array

Optional callback: function

▸ (): void

Returns: void


writeln

writeln(data: string Uint8Array, callback?: function): void

Defined in xterm.d.ts:948

Parameters:

data: *string Uint8Array*

Optional callback: function

▸ (): void

Returns: void