Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlessedProgram

The Program instance manages the low level interaction the the terminal. It emit the basi native events to the screens. It has associated an output writable stream attribute which ussually is stdout but could could be conigured by the user using IBlessedProgramOptions. The same for an input Readable stream from which the host terminal respond to the program requests.

The communication with the host system is mostly done writing tput sequences to the output stream. The program is responsible of portability and supporting the same API thgouth several terminal standards / vendors

Although the BlessedProgram instances are not Nodes (unlike Screens that are) they have a somwhat similar API, emiting events with similar names and has some simlar attributes, but it's important to known that most of these events and attributes refer to the host terminal window and not with the lines inside the screen. For example, focus or blur event refers to the terminal window focus, not the internal Blessed Element

In general users don't have to use the program for develop their applications, however, it can be accessed from the screen and its lower level api can be used along the application.

Example 1

Starting a program alone, and register 'q' to exist

const program = blessed.program({
})
program.setMouse({
allMotion: true,
}, true);
program.alternateBuffer()
program.enableMouse()
program.key(['q', 'escape', 'C-c'], function () {
program.showCursor()
program.disableMouse()
program.normalBuffer()
process.exit(0)
})

Example 2:

Registering for resize, blur, and focus terminal window native events:

program.setMouse({ sendFocus: true }, true)
program.on('resize', function (data) {
setTimeout(function () {
program.clear();
program.cup(0, 0);
}, 200);
});
process.on('SIGWINCH', function (data) {
setTimeout(function () {
program.cup(1, 0);
}, 200);
});
program.on('focus', function (data) {
program.clear();
program.cup(0, 0);
});
program.on('blur', function (data) {
program.clear();
program.cup(0, 0);
});

Example 3:

Drawing on mouse move

program.setBackground('green', 'O')
program.setForeground('red', 'i')
program.on('mouse', function (data) {
program.cup(data.y, data.x);
program.write(' ', 'blue bg');
program.write('as', 'red fg');
program.cup(0, 0);
});

Example 4

Setting the cursor style

program.showCursor();
program.setCursorStyle(1);
setTimeout(() => {
program.setCursorStyle(2);
}, 9000);
setTimeout(() => {
program.setCursorStyle(4);
}, 3000);
setTimeout(() => {
program.setCursorStyle(3);
}, 6000);

Example 5

Minimize / Maximize the terminal window and requesting it size and position and cursor

program.write('MINIMIZING IN 2 seconds')
setTimeout(() => {
program.manipulateWindow(2, (err, data)=>{
program.log(data);
})
}, 2000)
setTimeout(() => {
program.manipulateWindow(1, (err, data)=>{
program.log(data);
})
}, 4000)
program.getCursor(function(err, data) {
program.write(util.inspect(data));
});
program.getWindowSize(function(err:any, data:any) {
program.log('getWindowSize', data);
});

Hierarchy

  • EventEmitter
    • BlessedProgram

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

cols

cols: number

Optional gpm

internal

input

input: Readable

isAlt

isAlt: boolean

isLXDE

isLXDE: boolean

isOSXTerm

isOSXTerm: boolean

isRxvt

isRxvt: boolean

isTerminator

isTerminator: boolean

isVTE

isVTE: boolean

isXFCE

isXFCE: boolean

isXterm

isXterm: boolean

isiTerm2

isiTerm2: boolean

options

output

output: Writable

restoreReportedCursor

restoreReportedCursor: function

Type declaration

    • (): boolean
    • Returns boolean

resume

resume: function

Type declaration

    • (): void
    • Returns void

rows

rows: number

savedX

savedX: number

savedY

savedY: number

scrollBottom

scrollBottom: number

scrollTop

scrollTop: number

tmux

tmux: boolean

tmuxVersion

tmuxVersion: number

type

type: string

useBuffer

useBuffer: boolean

x

x: number

y

y: number

zero

zero: boolean

Is zero-based indexes for col, row values.

Static defaultMaxListeners

defaultMaxListeners: number

Static instances

instances: BlessedProgram[]
internal

Methods

HPositionRelative

  • HPositionRelative(param?: number): boolean

HVPosition

  • HVPosition(row?: number, col?: number): boolean
  • Parameters

    • Optional row: number
    • Optional col: number

    Returns boolean

VPositionRelative

  • VPositionRelative(param?: number): boolean

_ncoords

  • _ncoords(): void

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

ae

  • ae(): boolean

alternate

  • alternate(): boolean

alternateBuffer

  • alternateBuffer(): boolean

as

  • as(): boolean

back

  • back(n?: number): boolean

backspace

  • backspace(): boolean

bel

  • bel(): boolean

bell

  • bell(): boolean

bg

  • bg(color: string, val?: string): boolean

bindMouse

  • bindMouse(): void

bindResponse

  • bindResponse(): void

cbt

  • cbt(param?: number): boolean

cha

  • cha(param?: number): boolean

charAttributes

  • charAttributes(param: string, val?: string): boolean
  • charAttributes(param: string[], val?: string): boolean
  • ` CSI Pm m Character Attributes (SGR). Ps = 0 -> Normal (default). Ps = 1 -> Bold. Ps = 4 -> Underlined. Ps = 5 -> Blink (appears as Bold). Ps = 7 -> Inverse. Ps = 8 -> Invisible, i.e., hidden (VT300). Ps = 2 2 -> Normal (neither bold nor faint). Ps = 2 4 -> Not underlined. Ps = 2 5 -> Steady (not blinking). Ps = 2 7 -> Positive (not inverse). Ps = 2 8 -> Visible, i.e., not hidden (VT300). Ps = 3 0 -> Set foreground color to Black. Ps = 3 1 -> Set foreground color to Red. Ps = 3 2 -> Set foreground color to Green. Ps = 3 3 -> Set foreground color to Yellow. Ps = 3 4 -> Set foreground color to Blue. Ps = 3 5 -> Set foreground color to Magenta. Ps = 3 6 -> Set foreground color to Cyan. Ps = 3 7 -> Set foreground color to White. Ps = 3 9 -> Set foreground color to default (original). Ps = 4 0 -> Set background color to Black. Ps = 4 1 -> Set background color to Red. Ps = 4 2 -> Set background color to Green. Ps = 4 3 -> Set background color to Yellow. Ps = 4 4 -> Set background color to Blue. Ps = 4 5 -> Set background color to Magenta. Ps = 4 6 -> Set background color to Cyan. Ps = 4 7 -> Set background color to White. Ps = 4 9 -> Set background color to default (original).

    If 16-color support is compiled, the following apply. Assume that xterm's resources are set so that the ISO color codes are the first 8 of a set of 16. Then the aixterm colors are the bright versions of the ISO colors: Ps = 9 0 -> Set foreground color to Black. Ps = 9 1 -> Set foreground color to Red. Ps = 9 2 -> Set foreground color to Green. Ps = 9 3 -> Set foreground color to Yellow. Ps = 9 4 -> Set foreground color to Blue. Ps = 9 5 -> Set foreground color to Magenta. Ps = 9 6 -> Set foreground color to Cyan. Ps = 9 7 -> Set foreground color to White. Ps = 1 0 0 -> Set background color to Black. Ps = 1 0 1 -> Set background color to Red. Ps = 1 0 2 -> Set background color to Green. Ps = 1 0 3 -> Set background color to Yellow. Ps = 1 0 4 -> Set background color to Blue. Ps = 1 0 5 -> Set background color to Magenta. Ps = 1 0 6 -> Set background color to Cyan. Ps = 1 0 7 -> Set background color to White.

    If xterm is compiled with the 16-color support disabled, it supports the following, from rxvt: Ps = 1 0 0 -> Set foreground and background color to default.

    If 88- or 256-color support is compiled, the following apply. Ps = 3 8 ; 5 ; Ps -> Set foreground color to the second Ps. Ps = 4 8 ; 5 ; Ps -> Set background color to the second Ps. `

    Parameters

    • param: string
    • Optional val: string

    Returns boolean

  • Parameters

    • param: string[]
    • Optional val: string

    Returns boolean

charPosAbsolute

  • charPosAbsolute(param?: number): boolean

charset

  • charset(val?: string, level?: number): boolean
  • Parameters

    • Optional val: string
    • Optional level: number

    Returns boolean

cht

  • cht(param?: number): boolean

civis

  • civis(): boolean

clear

  • clear(): boolean

cnl

  • cnl(param?: number): boolean
  • cursornextline

    Parameters

    • Optional param: number

    Returns boolean

copyRectangle

  • copyRectangle(...args: string[]): boolean
  • ` CSI Pt; Pl; Pb; Pr; Pp; Pt; Pl; Pp$ v Copy Rectangular Area (DECCRA, VT400 and up). Pt; Pl; Pb; Pr denotes the rectangle. Pp denotes the source page. Pt; Pl denotes the target location. Pp denotes the target page. NOTE: xterm doesn't enable this code by default.`

    Parameters

    • Rest ...args: string[]

    Returns boolean

copyToClipboard

  • copyToClipboard(text: string): boolean

cpl

  • cpl(param?: number): boolean

cr

  • cr(): boolean

csr

  • csr(top: number, bottom: number): boolean

cub

  • cub(n?: number): boolean

cud

  • cud(n?: number): boolean

cuf

  • cuf(n?: number): boolean

cup

  • cup(row?: number, col?: number): boolean
  • CSI Ps ; Ps H Cursor Position [ row;column ] (default = [ 1,1 ]) (CUP).

    Parameters

    • Optional row: number
    • Optional col: number

    Returns boolean

cursorBackward

  • cursorBackward(n?: number): boolean

cursorBackwardTab

  • cursorBackwardTab(param?: number): boolean
  • CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).

    Parameters

    • Optional param: number

    Returns boolean

cursorCharAbsolute

  • cursorCharAbsolute(x: number): number
  • cursorCharAbsolute(param?: number): boolean

cursorColor

  • cursorColor(color: string): boolean

cursorDown

  • cursorDown(n?: number): boolean
  • Cursor Down n times, by default 1.

    Parameters

    • Optional n: number

    Returns boolean

cursorForward

  • cursorForward(n?: number): boolean

cursorForwardTab

  • cursorForwardTab(param?: number): boolean
  • Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).

    Parameters

    • Optional param: number

    Returns boolean

cursorNextLine

  • cursorNextLine(param?: number): boolean
  • CSI Ps E
    Cursor Next Line Ps Times (default = 1) (CNL).
    same as CSI Ps B ?

    Parameters

    • Optional param: number

    Returns boolean

cursorPos

  • cursorPos(row?: number, col?: number): boolean
  • CSI Ps ; Ps H Cursor Position [ row;column ] (default = [ 1,1 ]) (CUP).

    Parameters

    • Optional row: number
    • Optional col: number

    Returns boolean

cursorPrecedingLine

  • cursorPrecedingLine(param?: number): boolean

cursorReset

  • cursorReset(): boolean

cursorShape

  • cursorShape(shape: "block" | "underline" | "line", blink?: boolean): boolean
  • Parameters

    • shape: "block" | "underline" | "line"
    • Optional blink: boolean

    Returns boolean

cursorUp

  • cursorUp(param?: number): boolean

cursor_invisible

  • cursor_invisible(): boolean

cuu

  • cuu(param?: number): boolean

da

  • da(param?: number, callback?: Function): boolean
  • Parameters

    • Optional param: number
    • Optional callback: Function

    Returns boolean

dch

  • dch(param?: number): boolean

debug

  • debug(s: string): boolean

deccara

  • deccara(...args: string[]): boolean

deccra

  • deccra(...args: string[]): boolean

decdc

  • decdc(...args: string[]): boolean

decefr

  • decefr(...args: string[]): boolean

decelr

  • decelr(...args: string[]): boolean

decera

  • decera(...args: string[]): boolean

decfra

  • decfra(...args: string[]): boolean

decic

  • decic(...args: string[]): boolean

decll

  • decll(param?: number): boolean

decrara

  • decrara(...args: string[]): boolean

decreqtparm

  • decreqtparm(param: number): boolean

decrqlp

decrqm

  • decrqm(param?: number): boolean

decrqmp

  • decrqmp(param?: number): boolean

decrst

  • decrst(...args: string[]): boolean

decsace

  • decsace(param?: number): boolean

decsca

  • decsca(param?: number): boolean

decscl

  • decscl(...args: string[]): boolean

decscursr

  • decscursr(cursor: number): boolean

decsera

  • decsera(...args: string[]): boolean

decset

  • decset(...args: string[]): boolean

decsle

  • decsle(...args: string[]): boolean

decstbm

  • decstbm(top: number, bottom: number): boolean

decstr

  • decstr(): boolean

decswbv

  • decswbv(param?: number): boolean

dectcemh

  • dectcemh(): boolean

deleteChars

  • deleteChars(param?: number): boolean

deleteColumns

  • deleteColumns(...args: string[]): boolean
  • CSI P m SP ~
    Delete P s Column(s) (default = 1) (DECDC), VT420 and up
    NOTE: xterm doesn't enable this code by default.

    Parameters

    • Rest ...args: string[]

    Returns boolean

deleteLines

  • deleteLines(param?: number): boolean

destroy

  • destroy(): void

deviceStatus

  • CSI Ps n  Device Status Report (DSR).
    Ps = 5  -> Status Report.  Result (``OK'') is
    CSI 0 n
    Ps = 6  -> Report Cursor Position (CPR) [row;column].
    Result is
    CSI r ; c R
    CSI ? Ps n
    Device Status Report (DSR, DEC-specific).
    Ps = 6  -> Report Cursor Position (CPR) [row;column] as CSI
    ? r ; c R (assumes page is zero).
    Ps = 1 5  -> Report Printer status as CSI ? 1 0  n  (ready).
    or CSI ? 1 1  n  (not ready).
    Ps = 2 5  -> Report UDK status as CSI ? 2 0  n  (unlocked)
    or CSI ? 2 1  n  (locked).
    Ps = 2 6  -> Report Keyboard status as
    CSI ? 2 7  ;  1  ;  0  ;  0  n  (North American).
    The last two parameters apply to VT400 & up, and denote key-
    board ready and LK01 respectively.
    Ps = 5 3  -> Report Locator status as
    CSI ? 5 3  n  Locator available, if compiled-in, or
    CSI ? 5 0  n  No Locator, if not.

    Parameters

    • Optional param: string
    • Optional callback: ProgramResponseCallback
    • Optional dec: boolean
    • Optional noBypass: boolean

    Returns boolean

disableGpm

  • disableGpm(): void

disableModifieres

  • disableModifieres(...args: string[]): boolean

disableMouse

  • disableMouse(): void

dl

  • dl(param?: number): boolean

down

  • down(n?: number): boolean

dsr

  • dsr(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean
  • Parameters

    • Optional param: string
    • Optional callback: Function
    • Optional dec: boolean
    • Optional noBypass: boolean

    Returns boolean

dynamicColors

  • dynamicColors(param?: string): boolean
  • OSC Ps ; Pt ST OSC Ps ; Pt BEL Change dynamic colors

    Parameters

    • Optional param: string

    Returns boolean

ech

  • ech(param?: number): boolean

echo

  • echo(text: string, attr?: boolean): boolean
  • Parameters

    • text: string
    • Optional attr: boolean

    Returns boolean

ed

  • ed(param?: string): boolean

el

  • el(param?: string): boolean

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

enableFilterRectangle

  • enableFilterRectangle(...args: string[]): boolean
  • ` CSI Pt ; Pl ; Pb ; Pr ' w Enable Filter Rectangle (DECEFR), VT420 and up. Parameters are [top;left;bottom;right]. Defines the coordinates of a filter rectangle and activates it. Anytime the locator is detected outside of the filter rectangle, an outside rectangle event is generated and the rectangle is disabled. Filter rectangles are always treated as "one-shot" events. Any parameters that are omitted default to the current locator position. If all parameters are omit- ted, any locator motion will be reported. DECELR always can- cels any prevous rectangle definition.`

    Parameters

    • Rest ...args: string[]

    Returns boolean

enableGpm

  • enableGpm(): void

enableLocatorReporting

  • enableLocatorReporting(...args: string[]): boolean
  • `

    CSI Ps ; Pu ' z Enable Locator Reporting (DECELR). Valid values for the first parameter: Ps = 0 -> Locator disabled (default). Ps = 1 -> Locator enabled. Ps = 2 -> Locator enabled for one report, then disabled. The second parameter specifies the coordinate unit for locator reports. Valid values for the second parameter: Pu = 0 <- or omitted -> default to character cells. Pu = 1 <- device physical pixels. Pu = 2 <- character cells. `

    Parameters

    • Rest ...args: string[]

    Returns boolean

enableMouse

  • enableMouse(): void

enter_alt_charset_mode

  • enter_alt_charset_mode(): boolean

eraseChars

  • eraseChars(param?: number): boolean

eraseInDisplay

  • eraseInDisplay(param?: string): boolean

eraseInLine

  • eraseInLine(param?: string): boolean

eraseRectangle

  • eraseRectangle(...args: string[]): boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

exit_alt_charset_mode

  • exit_alt_charset_mode(): boolean

feed

  • feed(): boolean

ff

  • ff(): boolean

fg

  • fg(color: string, val?: boolean): string

fillRectangle

  • fillRectangle(Pc: string, Pt: number, pl: number, pb: number, pr: number): boolean
  • CSI Pc; Pt; Pl; Pb; Pr$ x
    Fill Rectangular Area (DECFRA), VT420 and up.
    Pc is the character to use.
    Pt; Pl; Pb; Pr denotes the rectangle.
    NOTE: xterm doesn't enable this code by default.

    Parameters

    • Pc: string
    • Pt: number
    • pl: number
    • pb: number
    • pr: number

    Returns boolean

flush

  • flush(): void

form

  • form(): boolean

forward

  • forward(n?: number): boolean

getCursor

getCursorColor

  • getCursorColor(callback: Function): boolean
  • example call:

    program.getCursor(function(err, data) {
    program.log('getCursor', data);
    program.write(util.inspect(data));
    });

    Parameters

    • callback: Function

    Returns boolean

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getTextParams

  • getTextParams(param: string, callback: Function): boolean
  • Parameters

    • param: string
    • callback: Function

    Returns boolean

getWindowSize

has

  • has(name: string): boolean
  • Queries whether the terminal has the capability name.

    Parameters

    • name: string

    Returns boolean

hideCursor

  • hideCursor(): boolean

hpa

  • hpa(param?: number): boolean

ht

  • ht(): boolean

hvp

  • hvp(row?: number, col?: number): boolean
  • Parameters

    • Optional row: number
    • Optional col: number

    Returns boolean

ich

  • ich(param?: number): boolean

il

  • il(param?: number): boolean

ind

  • ind(): boolean

index

  • index(): boolean

initMouseTracking

  • initMouseTracking(...args: string[]): boolean
  • CSI Ps ; Ps ; Ps ; Ps ; Ps T
    Initiate highlight mouse tracking.  Parameters are
    [func;startx;starty;firstrow;lastrow].  See the section Mouse
    Tracking.

    Parameters

    • Rest ...args: string[]

    Returns boolean

insertChars

  • insertChars(param?: number): boolean
  • CSI Ps @ Insert Ps (Blank) Character(s) (default = 1) (ICH).

    Parameters

    • Optional param: number

    Returns boolean

insertColumns

  • insertColumns(...args: string[]): boolean
  • CSI P m SP }
    Insert P s Column(s) (default = 1) (DECIC), VT420 and up.
    NOTE: xterm doesn't enable this code by default.

    Parameters

    • Rest ...args: string[]

    Returns boolean

insertLines

  • insertLines(param?: number): boolean

kbs

  • kbs(): boolean

key

left

  • left(n?: number): boolean

lineHeight

  • lineHeight(): boolean

linePosAbsolute

  • linePosAbsolute(param?: number): boolean

listen

  • listen(): void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

loadLEDs

  • loadLEDs(param?: number): boolean

log

  • log(...args: any[]): boolean
  • Writes arguments to log file passed in options.

    Parameters

    • Rest ...args: any[]

    Returns boolean

lrestoreCursor

  • lrestoreCursor(key?: string, hide?: boolean): void
  • Parameters

    • Optional key: string
    • Optional hide: boolean

    Returns void

lsaveCursor

  • lsaveCursor(key?: string): void

manipulateWindow

  • ` CSI Ps ; Ps ; Ps t Window manipulation (from dtterm, as well as extensions). These controls may be disabled using the allowWindowOps resource. Valid values for the first (and any additional parameters) are:Ps = 1 -> De-iconify window. Ps = 2 -> Iconify window. Ps = 3 ; x ; y -> Move window to [x, y]. Ps = 4 ; height ; width -> Resize the xterm window to height and width in pixels. Ps = 5 -> Raise the xterm window to the front of the stack- ing order. Ps = 6 -> Lower the xterm window to the bottom of the stacking order. Ps = 7 -> Refresh the xterm window. Ps = 8 ; height ; width -> Resize the text area to [height;width] in characters. Ps = 9 ; 0 -> Restore maximized window. Ps = 9 ; 1 -> Maximize window (i.e., resize to screen size). Ps = 1 0 ; 0 -> Undo full-screen mode. Ps = 1 0 ; 1 -> Change to full-screen. Ps = 1 1 -> Report xterm window state. If the xterm window is open (non-iconified), it returns CSI 1 t . If the xterm window is iconified, it returns CSI 2 t . Ps = 1 3 -> Report xterm window position. Result is CSI 3 ; x ; y t Ps = 1 4 -> Report xterm window in pixels. Result is CSI 4 ; height ; width t Ps = 1 8 -> Report the size of the text area in characters. Result is CSI 8 ; height ; width t Ps = 1 9 -> Report the size of the screen in characters. Result is CSI 9 ; height ; width t Ps = 2 0 -> Report xterm window's icon label. Result is OSC L label ST Ps = 2 1 -> Report xterm window's title. Result is OSC l label ST Ps = 2 2 ; 0 -> Save xterm icon and window title on stack. Ps = 2 2 ; 1 -> Save xterm icon title on stack. Ps = 2 2 ; 2 -> Save xterm window title on stack. Ps = 2 3 ; 0 -> Restore xterm icon and window title from stack. Ps = 2 3 ; 1 -> Restore xterm icon title from stack. Ps = 2 3 ; 2 -> Restore xterm window title from stack. Ps >= 2 4 -> Resize to Ps lines (DECSLPP). Ps >= 2 4 -> Resize to Ps lines (DECSLPP). ``Example call: `` program.manipulateWindow(18, function(err:any, data:any) { program.log('manipulateWindow', data); });

    `

    Parameters

    Returns boolean

  • Parameters

    Returns boolean

mc

  • mc(...args: string[]): boolean

mc0

  • mc0(): boolean

mc4

  • mc4(): boolean

mc5

  • mc5(): boolean

mc5p

  • mc5p(): boolean

mediaCopy

  • mediaCopy(...args: string[]): boolean

move

  • move(x: number, y: number): boolean

newline

  • newline(): boolean

nextLine

  • nextLine(): boolean

nl

  • nl(): boolean

normalBuffer

  • normalBuffer(): boolean

nul

  • nul(): boolean

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

omove

  • omove(x: number, y: number): void

on

  • on(e: "mouse", c: function): this
  • on(e: "resize", c: function): this
  • on(e: "focus", c: function): this
  • on(e: "blur", c: function): this
  • on(e: "keypress", c: KeyEventListener): this
  • on(event: "warning", callback: function): this
  • on(e: string, c: function): this
  • triggered when native events in the host terminal window

    Parameters

    • e: "mouse"
    • c: function

    Returns this

  • triggered when the terminal window is resized.

    Parameters

    • e: "resize"
    • c: function
        • (e: object): void
        • Parameters

          • e: object
            • cols: number
            • rows: number
            • winch: boolean

          Returns void

    Returns this

  • triggered when the terminal window gains focus n the host window manager. For exmmple when the user switchst form another application to the terminal with ctrl-tab. Notice that these are native events, ocurring outside the terminal application.

    Parameters

    • e: "focus"
    • c: function
        • (e: any): void
        • Parameters

          • e: any

          Returns void

    Returns this

  • triggered when the terminal window loose focus host window manager. For exmmple when the user switchs from the shell to another form another application . Notice that these are native events, ocurring outside the terminal application.

    Parameters

    • e: "blur"
    • c: function
        • (e: any): void
        • Parameters

          • e: any

          Returns void

    Returns this

  • Parameters

    Returns this

  • Received when blessed notices something untoward (output is not a tty, terminfo not found, etc).

    Parameters

    • event: "warning"
    • callback: function
        • (text: string): void
        • Parameters

          • text: string

          Returns void

    Returns this

  • Parameters

    • e: string
    • c: function
        • (e: any): void
        • Parameters

          • e: any

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

onceKey

out

  • out(param: string, ...args: any[]): boolean
  • Parameters

    • param: string
    • Rest ...args: any[]

    Returns boolean

p0

  • p0(): boolean

pause

pf

  • pf(): boolean

po

  • po(): boolean

pos

  • pos(row?: number, col?: number): boolean
  • CSI Ps ; Ps H Cursor Position [ row;column ] (default = [ 1,1 ]) (CUP).

    Parameters

    • Optional row: number
    • Optional col: number

    Returns boolean

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

print

  • print(text: string, attr?: boolean): boolean
  • Determines whether to include text attributes when writing.

    Parameters

    • text: string
    • Optional attr: boolean

    Returns boolean

print_screen

  • print_screen(): boolean

prtr_non

  • prtr_non(): boolean

prtr_off

  • prtr_off(): boolean

prtr_on

  • prtr_on(): boolean

ps

  • ps(): boolean

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

rc

  • rc(key?: string, hide?: boolean): boolean
  • Parameters

    • Optional key: string
    • Optional hide: boolean

    Returns boolean

rcA

  • rcA(): boolean

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeKey

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rep

  • rep(param?: number): boolean

repeat

  • repeat(ch: string, i?: number): string
  • Parameters

    • ch: string
    • Optional i: number

    Returns string

repeatPrecedingCharacter

  • repeatPrecedingCharacter(param?: number): boolean

req_mouse_pos

reqmp

requestAnsiMode

  • requestAnsiMode(param?: number): boolean

requestLocatorPosition

  • ` CSI Ps ' | Request Locator Position (DECRQLP). Valid values for the parameter are: Ps = 0 , 1 or omitted -> transmit a single DECLRP locator report.

    If Locator Reporting has been enabled by a DECELR, xterm will respond with a DECLRP Locator Report. This report is also generated on button up and down events if they have been enabled with a DECSLE, or when the locator is detected outside of a filter rectangle, if filter rectangles have been enabled with a DECEFR.

    -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w

    Parameters are [event;button;row;column;page]. Valid values for the event: Pe = 0 -> locator unavailable - no other parameters sent. Pe = 1 -> request - xterm received a DECRQLP. Pe = 2 -> left button down. Pe = 3 -> left button up. Pe = 4 -> middle button down. Pe = 5 -> middle button up. Pe = 6 -> right button down. Pe = 7 -> right button up. Pe = 8 -> M4 button down. Pe = 9 -> M4 button up. Pe = 1 0 -> locator outside filter rectangle. button'' parameter is a bitmask indicating which buttons are pressed: Pb = 0 <- no buttons down. Pb & 1 <- right button down. Pb & 2 <- middle button down. Pb & 4 <- left button down. Pb & 8 <- M4 button down.row'' andcolumn'' parameters are the coordinates of the locator position in the xterm window, encoded as ASCII deci- mal. Thepage'' parameter is not used by xterm, and will be omit- ted. `

    Parameters

    Returns boolean

requestParameters

  • requestParameters(param?: number): boolean
  • CSI Ps x  Request Terminal Parameters (DECREQTPARM).
    if Ps is a "0" (default) or "1", and xterm is emulating VT100,
    the control sequence elicits a response of the same form whose
    parameters describe the terminal:
    Ps -> the given Ps incremented by 2.
    Pn = 1  <- no parity.
    Pn = 1  <- eight bits.
    Pn = 1  <- 2  8  transmit 38.4k baud.
    Pn = 1  <- 2  8  receive 38.4k baud.
    Pn = 1  <- clock multiplier.
    Pn = 0  <- STP flags.

    Parameters

    • Optional param: number

    Returns boolean

requestPrivateMode

  • requestPrivateMode(param?: number): boolean

reset

  • reset(): boolean

resetColors

  • resetColors(param?: string): boolean

resetCursor

  • resetCursor(): boolean

resetMode

  • resetMode(...args: string[]): boolean
  • CSI Pm l  Reset Mode (RM).
    Ps = 2  -> Keyboard Action Mode (AM).
    Ps = 4  -> Replace Mode (IRM).
    Ps = 1 2  -> Send/receive (SRM).
    Ps = 2 0  -> Normal Linefeed (LNM).
    CSI ? Pm l
    DEC Private Mode Reset (DECRST).
    Ps = 1  -> Normal Cursor Keys (DECCKM).
    Ps = 2  -> Designate VT52 mode (DECANM).
    Ps = 3  -> 80 Column Mode (DECCOLM).
    Ps = 4  -> Jump (Fast) Scroll (DECSCLM).
    Ps = 5  -> Normal Video (DECSCNM).
    Ps = 6  -> Normal Cursor Mode (DECOM).
    Ps = 7  -> No Wraparound Mode (DECAWM).
    Ps = 8  -> No Auto-repeat Keys (DECARM).
    Ps = 9  -> Don't send Mouse X & Y on button press.
    Ps = 1 0  -> Hide toolbar (rxvt).
    Ps = 1 2  -> Stop Blinking Cursor (att610).
    Ps = 1 8  -> Don't print form feed (DECPFF).
    Ps = 1 9  -> Limit print to scrolling region (DECPEX).
    Ps = 2 5  -> Hide Cursor (DECTCEM).
    Ps = 3 0  -> Don't show scrollbar (rxvt).
    Ps = 3 5  -> Disable font-shifting functions (rxvt).
    Ps = 4 0  -> Disallow 80 -> 132 Mode.
    Ps = 4 1  -> No more(1) fix (see curses resource).
    Ps = 4 2  -> Disable Nation Replacement Character sets (DEC-
    NRCM).
    Ps = 4 4  -> Turn Off Margin Bell.
    Ps = 4 5  -> No Reverse-wraparound Mode.
    Ps = 4 6  -> Stop Logging.  (This is normally disabled by a
    compile-time option).
    Ps = 4 7  -> Use Normal Screen Buffer.
    Ps = 6 6  -> Numeric keypad (DECNKM).
    Ps = 6 7  -> Backarrow key sends delete (DECBKM).
    Ps = 1 0 0 0  -> Don't send Mouse X & Y on button press and
    release.  See the section Mouse Tracking.
    Ps = 1 0 0 1  -> Don't use Hilite Mouse Tracking.
    Ps = 1 0 0 2  -> Don't use Cell Motion Mouse Tracking.
    Ps = 1 0 0 3  -> Don't use All Motion Mouse Tracking.
    Ps = 1 0 0 4  -> Don't send FocusIn/FocusOut events.
    Ps = 1 0 0 5  -> Disable Extended Mouse Mode.
    Ps = 1 0 1 0  -> Don't scroll to bottom on tty output
    (rxvt).
    Ps = 1 0 1 1  -> Don't scroll to bottom on key press (rxvt).
    Ps = 1 0 3 4  -> Don't interpret "meta" key.  (This disables
    the eightBitInput resource).
    Ps = 1 0 3 5  -> Disable special modifiers for Alt and Num-
    Lock keys.  (This disables the numLock resource).
    Ps = 1 0 3 6  -> Don't send ESC  when Meta modifies a key.
    (This disables the metaSendsEscape resource).
    Ps = 1 0 3 7  -> Send VT220 Remove from the editing-keypad
    Delete key.
    Ps = 1 0 3 9  -> Don't send ESC  when Alt modifies a key.
    (This disables the altSendsEscape resource).
    Ps = 1 0 4 0  -> Do not keep selection when not highlighted.
    (This disables the keepSelection resource).
    Ps = 1 0 4 1  -> Use the PRIMARY selection.  (This disables
    the selectToClipboard resource).
    Ps = 1 0 4 2  -> Disable Urgency window manager hint when
    Control-G is received.  (This disables the bellIsUrgent
    resource).
    Ps = 1 0 4 3  -> Disable raising of the window when Control-
    G is received.  (This disables the popOnBell resource).
    Ps = 1 0 4 7  -> Use Normal Screen Buffer, clearing screen
    first if in the Alternate Screen.  (This may be disabled by
    the titeInhibit resource).
    Ps = 1 0 4 8  -> Restore cursor as in DECRC.  (This may be
    disabled by the titeInhibit resource).
    Ps = 1 0 4 9  -> Use Normal Screen Buffer and restore cursor
    as in DECRC.  (This may be disabled by the titeInhibit
    resource).  This combines the effects of the 1 0 4 7  and 1 0
    4 8  modes.  Use this with terminfo-based applications rather
    than the 4 7  mode.
    Ps = 1 0 5 0  -> Reset terminfo/termcap function-key mode.
    Ps = 1 0 5 1  -> Reset Sun function-key mode.
    Ps = 1 0 5 2  -> Reset HP function-key mode.
    Ps = 1 0 5 3  -> Reset SCO function-key mode.
    Ps = 1 0 6 0  -> Reset legacy keyboard emulation (X11R6).
    Ps = 1 0 6 1  -> Reset keyboard emulation to Sun/PC style.
    Ps = 2 0 0 4  -> Reset bracketed paste mode.

    Parameters

    • Rest ...args: string[]

    Returns boolean

resetTitleModes

  • resetTitleModes(...args: string[]): boolean
  • CSI > Ps; Ps T
    Reset one or more features of the title modes to the default
    value.  Normally, "reset" disables the feature.  It is possi-
    ble to disable the ability to reset features by compiling a
    different default for the title modes into xterm.
    Ps = 0  -> Do not set window/icon labels using hexadecimal.
    Ps = 1  -> Do not query window/icon labels using hexadeci-
    mal.
    Ps = 2  -> Do not set window/icon labels using UTF-8.
    Ps = 3  -> Do not query window/icon labels using UTF-8.
    (See discussion of "Title Modes").

    Parameters

    • Rest ...args: string[]

    Returns boolean

response

  • response(name: string, text: string, callback: Function, noBypass?: boolean): boolean
  • response(name: string, callback?: Function): boolean
  • Parameters

    • name: string
    • text: string
    • callback: Function
    • Optional noBypass: boolean

    Returns boolean

  • Parameters

    • name: string
    • Optional callback: Function

    Returns boolean

restoreCursor

  • restoreCursor(key?: string, hide?: boolean): boolean
  • Parameters

    • Optional key: string
    • Optional hide: boolean

    Returns boolean

restoreCursorA

  • restoreCursorA(): boolean

restorePrivateValues

  • restorePrivateValues(...args: string[]): boolean
  • CSI ? Pm r
    Restore DEC Private Mode Values.  The value of Ps previously
    saved is restored.  Ps values are the same as for DECSET.

    Parameters

    • Rest ...args: string[]

    Returns boolean

return

  • return(): boolean

reverse

  • reverse(): boolean

reverseAttrInRectangle

  • reverseAttrInRectangle(...args: string[]): boolean

reverseIndex

  • reverseIndex(): boolean

ri

  • ri(): boolean

right

  • right(n?: number): boolean

rm

  • rm(...args: string[]): boolean

rmacs

  • rmacs(): boolean

rmcup

  • rmcup(): boolean

rmove

  • rmove(x: number, y: number): void

rs2

  • rs2(): boolean

rsetx

  • rsetx(x: number): boolean

rsety

  • rsety(y: number): boolean

saveCursor

  • saveCursor(key: string): boolean

saveCursorA

  • saveCursorA(): boolean

savePrivateValues

  • savePrivateValues(...args: string[]): boolean
  • Save DEC Private Mode Values. Ps values are the same as for

    Parameters

    • Rest ...args: string[]

    Returns boolean

saveReportedCursor

sc

  • sc(key: string): boolean

scA

  • scA(): boolean

scrollDown

  • scrollDown(param?: number): boolean
  • CSI Ps T Scroll down Ps lines (default = 1) (SD).

    Parameters

    • Optional param: number

    Returns boolean

scrollUp

  • scrollUp(param?: number): boolean
  • CSI Ps S Scroll up Ps lines (default = 1) (SU).

    Parameters

    • Optional param: number

    Returns boolean

sd

  • sd(param?: number): boolean

selData

  • selData(a: string, b: string): boolean

selectChangeExtent

  • selectChangeExtent(param?: number): boolean
  • `

    CSI Ps x Select Attribute Change Extent (DECSACE). Ps = 0 -> from start to end position, wrapped. Ps = 1 -> from start to end position, wrapped. Ps = 2 -> rectangle (exact). `

    Parameters

    • Optional param: number

    Returns boolean

selectiveEraseRectangle

  • selectiveEraseRectangle(...args: string[]): boolean

sendDeviceAttributes

setAttrInRectangle

  • setAttrInRectangle(Pt: number, Pl: number, Pb: number, Pr: number, Ps$: number): boolean
  • CSI Pt; Pl; Pb; Pr; Ps$ r
    Change Attributes in Rectangular Area (DECCARA), VT400 and up.
    Pt; Pl; Pb; Pr denotes the rectangle.
    Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7.
    NOTE: xterm doesn't enable this code by default.

    Parameters

    • Pt: number
    • Pl: number
    • Pb: number
    • Pr: number
    • Ps$: number

    Returns boolean

setBackground

  • setBackground(color: string, val?: string): boolean
  • set the background color and character for the following writings to the output buffer. Example:

    program.setBackground('green', 'O')
    program.setForeground('red', 'i')
    program.on('mouse', function (data) {
    program.cup(data.y, data.x);
    program.write(' ', 'blue bg');
    program.write('as', 'red fg');
    program.cup(0, 0);
    });

    Parameters

    • color: string
    • Optional val: string

    Returns boolean

setCharProtectionAttr

  • setCharProtectionAttr(param?: number): boolean
  • CSI Ps " q
    Select character protection attribute (DECSCA).  Valid values
    for the parameter:
    Ps = 0  -> DECSED and DECSEL can erase (default).
    Ps = 1  -> DECSED and DECSEL cannot erase.
    Ps = 2  -> DECSED and DECSEL can erase.

    Parameters

    • Optional param: number

    Returns boolean

setConformanceLevel

  • setConformanceLevel(...args: string[]): boolean

setCursorStyle

  • setCursorStyle(cursor: 0 | 1 | 2 | 3 | 4 | "blinkingblock" | "block" | "steady block" | "blinking underline" | "underline" | "steady underline" | "blinking bar" | "bar" | "steady bar"): boolean
  • ` CSI Ps SP q Set cursor style (DECSCUSR, VT520). Ps = 0 -> blinking block. Ps = 1 -> blinking block (default). Ps = 2 -> steady block. Ps = 3 -> blinking underline. Ps = 4 -> steady underline. `

    Parameters

    • cursor: 0 | 1 | 2 | 3 | 4 | "blinkingblock" | "block" | "steady block" | "blinking underline" | "underline" | "steady underline" | "blinking bar" | "bar" | "steady bar"

    Returns boolean

setForeground

  • setForeground(color: string, val?: string): boolean
  • set the foreground color and character for the following writings to the output buffer. Example:

    program.setBackground('green', 'O')
    program.setForeground('red', 'i')
    program.on('mouse', function (data) {
    program.cup(data.y, data.x);
    program.write(' ', 'blue bg');
    program.write('as', 'red fg');
    program.cup(0, 0);
    });

    Parameters

    • color: string
    • Optional val: string

    Returns boolean

setG

  • setG(val: number): boolean

setLocatorEvents

  • setLocatorEvents(...args: string[]): boolean

setMarginBellVolume

  • setMarginBellVolume(param?: number): boolean

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setMode

  • ` CSI Pm h Set Mode (SM). Ps = 2 -> Keyboard Action Mode (AM). Ps = 4 -> Insert Mode (IRM). Ps = 1 2 -> Send/receive (SRM). Ps = 2 0 -> Automatic Newline (LNM). CSI ? Pm h DEC Private Mode Set (DECSET). Ps = 1 -> Application Cursor Keys (DECCKM). Ps = 2 -> Designate USASCII for character sets G0-G3 (DECANM), and set VT100 mode. Ps = 3 -> 132 Column Mode (DECCOLM). Ps = 4 -> Smooth (Slow) Scroll (DECSCLM). Ps = 5 -> Reverse Video (DECSCNM). Ps = 6 -> Origin Mode (DECOM). Ps = 7 -> Wraparound Mode (DECAWM). Ps = 8 -> Auto-repeat Keys (DECARM). Ps = 9 -> Send Mouse X & Y on button press. See the sec- tion Mouse Tracking. Ps = 1 0 -> Show toolbar (rxvt). Ps = 1 2 -> Start Blinking Cursor (att610). Ps = 1 8 -> Print form feed (DECPFF). Ps = 1 9 -> Set print extent to full screen (DECPEX). Ps = 2 5 -> Show Cursor (DECTCEM). Ps = 3 0 -> Show scrollbar (rxvt). Ps = 3 5 -> Enable font-shifting functions (rxvt). Ps = 3 8 -> Enter Tektronix Mode (DECTEK). Ps = 4 0 -> Allow 80 -> 132 Mode. Ps = 4 1 -> more(1) fix (see curses resource). Ps = 4 2 -> Enable Nation Replacement Character sets (DECN- RCM). Ps = 4 4 -> Turn On Margin Bell. Ps = 4 5 -> Reverse-wraparound Mode. Ps = 4 6 -> Start Logging. This is normally disabled by a compile-time option. Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis- abled by the titeInhibit resource). Ps = 6 6 -> Application keypad (DECNKM). Ps = 6 7 -> Backarrow key sends backspace (DECBKM). Ps = 1 0 0 0 -> Send Mouse X & Y on button press and release. See the section Mouse Tracking. Ps = 1 0 0 1 -> Use Hilite Mouse Tracking. Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking. Ps = 1 0 0 3 -> Use All Motion Mouse Tracking. Ps = 1 0 0 4 -> Send FocusIn/FocusOut events. Ps = 1 0 0 5 -> Enable Extended Mouse Mode. Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt). Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). Ps = 1 0 3 4 -> Interpret "meta" key, sets eighth bit. (enables the eightBitInput resource). Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num- Lock keys. (This enables the numLock resource). Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This enables the metaSendsEscape resource). Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete key. Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This enables the altSendsEscape resource). Ps = 1 0 4 0 -> Keep selection even if not highlighted. (This enables the keepSelection resource). Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables the selectToClipboard resource). Ps = 1 0 4 2 -> Enable Urgency window manager hint when Control-G is received. (This enables the bellIsUrgent resource). Ps = 1 0 4 3 -> Enable raising of the window when Control-G is received. (enables the popOnBell resource). Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be disabled by the titeInhibit resource). Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis- abled by the titeInhibit resource). Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate Screen Buffer, clearing it first. (This may be disabled by the titeInhibit resource). This combines the effects of the 1 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based applications rather than the 4 7 mode. Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode. Ps = 1 0 5 1 -> Set Sun function-key mode. Ps = 1 0 5 2 -> Set HP function-key mode. Ps = 1 0 5 3 -> Set SCO function-key mode. Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). Ps = 1 0 6 1 -> Set VT220 keyboard emulation. Ps = 2 0 0 4 -> Set bracketed paste mode. Modes: http://vt100.net/docs/vt220-rm/chapter4.html`

    Example: Show cursor:

    
    return this.setMode('?25', (error, data)=>{
    
    });

    Parameters

    Returns boolean

setMouse

  • setMouse(opt?: object, enable?: boolean): void
  • Parameters

    • Optional opt: object
      • [s: string]: any
      • Optional allMotion?: boolean
      • Optional decMouse?: boolean
      • Optional gpmMouse?: boolean
      • Optional hiliteTracking?: boolean
      • Optional jsbtermMouse?: boolean
      • Optional normalMouse?: boolean
      • Optional ptermMouse?: boolean
      • Optional sendFocus?: boolean
      • Optional sgrMouse?: boolean
      • Optional urxvtMouse?: boolean
      • Optional utfMode?: boolean
      • Optional vt200Mouse?: boolean
      • Optional x10Mouse?: boolean
    • Optional enable: boolean

    Returns void

setPointerMode

  • setPointerMode(...args: string[]): boolean
  • ` CSI > Ps p Set resource value pointerMode. This is used by xterm to decide whether to hide the pointer cursor as the user types. Valid values for the parameter: Ps = 0 -> never hide the pointer. Ps = 1 -> hide if the mouse tracking mode is not enabled. Ps = 2 -> always hide the pointer. If no parameter is given, xterm uses the default, which is 1 .

    `

    Parameters

    • Rest ...args: string[]

    Returns boolean

setResources

  • setResources(...args: string[]): boolean

setScrollRegion

  • setScrollRegion(top: number, bottom: number): boolean
  • CSI Ps ; Ps r
    Set Scrolling Region [top;bottom] (default = full size of win-
    dow) (DECSTBM).
    CSI ? Pm r

    Parameters

    • top: number
    • bottom: number

    Returns boolean

setTerminal

  • setTerminal(terminal: string): void

setTitle

  • setTitle(title: string): boolean

setTitleModeFeature

  • setTitleModeFeature(...args: string[]): boolean
  • CSI > Ps; Ps t Set one or more features of the title modes. Each parameter enables a single feature. Ps = 0 -> Set window/icon labels using hexadecimal. Ps = 1 -> Query window/icon labels using hexadecimal. Ps = 2 -> Set window/icon labels using UTF-8. Ps = 3 -> Query window/icon labels using UTF-8. (See dis- cussion of "Title Modes") XXX VTE bizarelly echos this:

    Parameters

    • Rest ...args: string[]

    Returns boolean

setWarningBellVolume

  • setWarningBellVolume(param?: number): boolean

setupDump

  • setupDump(): void

setupTput

  • setupTput(): void

setx

  • setx(x: number): boolean

sety

  • sety(y: number): boolean

shiftIn

  • shiftIn(): boolean

shiftOut

  • shiftOut(): boolean

showCursor

  • showCursor(): boolean
  • Uses setMode 2 5 to show the cursor: NOTE: In xterm terminfo: cnorm stops blinking cursor cvvis starts blinking cursor

    Returns boolean

sigtstp

simpleInsert

  • simpleInsert(ch: string, i?: number, attr?: boolean): boolean
  • Parameters

    • ch: string
    • Optional i: number
    • Optional attr: boolean

    Returns boolean

sm

  • sm(...args: string[]): boolean

smacs

  • smacs(): boolean

smcup

  • smcup(): boolean

softReset

  • softReset(): boolean

su

  • su(param?: number): boolean

tab

  • tab(): boolean

tabClear

  • tabClear(param?: number): boolean

tabSet

  • tabSet(): boolean

tbc

  • tbc(param?: number): boolean

term

  • term(is: string): boolean
  • Queries whether the terminal of the type is.

    Parameters

    • is: string

    Returns boolean

unKey

up

  • up(param?: number): boolean

vi

  • vi(): boolean

vpa

  • vpa(param?: number): boolean

vpr

  • vpr(param?: number): boolean

vtab

  • vtab(): boolean

write

  • write(text: string): boolean
  • write(text: string, style: string): boolean
  • Parameters

    • text: string

    Returns boolean

  • Writes to this.output Example: program.write('Hello world', 'blue fg')

    Parameters

    • text: string
    • style: string

    Returns boolean

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc