Native terminfo and ncurses bindings for Node.js, providing fast access to every terminal capability supported by the terminfo database. Runs on Node.js, Deno, and Bun.
npm install terminfo.nodeNative [terminfo] and [ncurses] bindings for [Deno], [Node.js], and [Bun].
---
This project provides a Node.js native addon for the [terminfo database] and a
subset of [ncurses], exposing terminal capabilities and the ability to query or
control terminal behavior in Deno, Bun, and Node.js applications alike.
``bash`
deno add jsr:terminfo.node
`bash`
pnpm add jsr:terminfo.node
`bash`
yarn add jsr:terminfo.node
`bash`
bunx jsr add terminfo.node
`bash`
npx jsr add terminfo.node
---
#### 1. Import [terminfo.node] and initialize terminfo
`ts
import ti from "terminfo.node";
// You MUST call .init([termname]) before any other API, else seg faults occur!
ti.init(); // uses $TERM by default
// or specify a termname explicitly
ti.init("xterm-256color"); // or "xterm", "vt100", "linux", "tmux", "rxvt", ...
`
#### 2. Use terminfo APIs!
`ts
import ti from "terminfo.node";
import { env, stdin, stdout } from "node:process";
import assert from "node:assert";
ti.init("xterm-256color");
// verifying the terminfo validity against process info
assert.strictEqual(ti.termname(), "xterm-256color");
assert.strictEqual(ti.columns(), stdout.columns);
assert.strictEqual(ti.lines(), stdout.rows);
assert.strictEqual(ti.has_colors(), stdout.getColorDepth() >= 8);
assert.strictEqual(ti.is_terminal_raw(), stdin.isRaw);
`
##### Example: Clear screen and write text at specific position
`ts
import ti from "terminfo.node";
import { stdout } from "node:process";
// ensure terminfo is initialized (using $TERM by default)
ti.init();
const clear = ti.cap("clear");
stdout.write(ti.enter_alt_screen() + clear);
stdout.write(ti.cursor_save() + ti.cursor_hide());
stdout.write(ti.tparm("cup", 5, 10) + "Hello, Terminfo!");
`
##### Example: request terminal info
`ts
import ti from "terminfo.node";
import assert from "node:assert";
// ensure terminfo is initialized
ti.init("xterm-256color");
console.log(ti.info());
`
##### Example: query capability values
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
assert.strictEqual(ti.has_colors(), true);
assert.strictEqual(ti.num_colors(), 256);
assert.strictEqual(ti.has_mouse_events(), true);
// .tigetstr("
assert.strictEqual(ti.tigetstr("kmous"), "\x1b[<");
// .cap("
assert.strictEqual(ti.cap("cub1"), "\x1b[D");
assert.strictEqual(ti.cap("cuf"), "\x1b[%dC");
assert.strictEqual(ti.cap("el"), "\x1b[K");
`
##### Example: use parameterized capabilities
`ts
import ti from "terminfo.node";
import { stdout } from "node:process";
ti.init();
const clear = ti.cap("clear");
stdout.write(ti.enter_alt_screen() + clear);
stdout.write(ti.cursor_save() + ti.cursor_hide());
// .tparm("
// a variadic number of parameters. It supports an arity of up to 9 arguments.
stdout.write(ti.tparm("cup", 5, 10) + "Hello, Terminfo!");
`
> [!NOTE]
>
> The parameters are 0-indexed. If a capability is noted as 1-indexed in the
> [terminfo database] for a given termname, it is adjusted automatically by the
> native tparm() implementation.`
>
> ts`
> import ti from "terminfo.node";
> import assert from "node:assert";
>
> ti.init("xterm-256color");
>
> // 0-indexed input, 0-indexed output
> assert.strictEqual(ti.tparm("dl", 3), "\x1b3M");
>
> // 0-indexed input, 1-indexed output
> assert.strictEqual(ti.tparm("hpa", 15), "\x1b[16G");
>
---
Table of Contents
- [Miscellaneous
- has_alt_scroll
- Metadata & Init
- init
- info
- termname
- longname
- baudrate
- columns
- erasechar
- killchar
- list_supported_terms
- Colors
- has_colors
- num_colors
- num_pairs
- can_change_color
- color_rgb
- back_color_erase
- max_colors
- orig_colors
- Capabilities
- tigetnum
- tigetflag
- tigetstr
- tparm
- sgr
- box_char
- cap
- Keyboard
- enable_keyboard
- disable_keyboard
- keys
- keycode
- unctrl
- resolve_key_code
- get_key_count
- get_key_modifiers
- is_ctrl
- is_alt
- is_shift
- key_a1
- key_a3
- key_b2
- key_backspace
- key_beg
- key_btab
- key_c1
- key_c3
- key_dc
- key_down
- key_end
- key_enter
- key_f1
- key_f10
- key_f11
- key_f12
- key_f13
- key_f14
- key_f15
- key_f16
- key_f17
- key_f18
- key_f19
- key_f2
- key_f20
- key_f21
- key_f22
- key_f23
- key_f24
- key_f25
- key_f26
- key_f27
- key_f28
- key_f29
- key_f3
- key_f30
- key_f31
- key_f32
- key_f33
- key_f34
- key_f35
- key_f36
- key_f37
- key_f38
- key_f39
- key_f4
- key_f40
- key_f41
- key_f42
- key_f43
- key_f44
- key_f45
- key_f46
- key_f47
- key_f48
- key_f49
- key_f5
- key_f50
- key_f51
- key_f52
- key_f53
- key_f54
- key_f55
- key_f56
- key_f57
- key_f58
- key_f59
- key_f6
- key_f60
- key_f61
- key_f62
- key_f63
- key_f7
- key_f8
- key_f9
- key_home
- key_ic
- key_left
- key_npage
- key_ppage
- key_right
- key_sdc
- key_send
- key_sf
- key_shome
- key_sic
- key_sleft
- key_snext
- key_sprevious
- key_sr
- key_sright
- key_up
- Termios
- stdin_fd
- stdout_fd
- stderr_fd
- isatty
- tcgetattr
- tcsetattr
- tcflush
- get_termios
- set_termios
- get_termios_constants
- is_terminal_raw
- is_terminal_cbreak
- is_terminal_normal
- enter_raw_mode
- enter_cbreak_mode
- exit_raw_mode
- exit_cbreak_mode
- restore
- Terminal Modes
- enter_normal_mode
- request_mode_status
- is_mode_supported
- is_mode_settable
- is_mode_enabled
- is_mode_disabled
- is_mode_permanent
- has_alt_screen
- has_bracketed_paste
- has_button_events
- has_motion_events
- has_focus_events
- Mouse
- has_mouse_support
- has_mouse_events
- has_x10_mouse
- has_vt200_mouse
- has_highlight_mouse
- has_utf8_mouse
- has_sgr_mouse
- has_urxvt_mouse
- has_pixel_mouse
- has_mouse
- enable_mouse
- disable_mouse
- parse_mouse
- get_mouse_x
- get_mouse_y
- get_mouse_button
- get_mouse_action
- get_mouse_modifiers
- key_mouse
- Modes
- enter_alt_charset_mode
- enter_am_mode
- enter_blink_mode
- enter_bold_mode
- enter_ca_mode
- enter_dim_mode
- enter_insert_mode
- enter_italics_mode
- enter_reverse_mode
- enter_secure_mode
- enter_standout_mode
- enter_underline_mode
- exit_alt_charset_mode
- exit_am_mode
- exit_attribute_mode
- exit_ca_mode
- exit_insert_mode
- exit_italics_mode
- exit_standout_mode
- exit_underline_mode
- move_insert_mode
- move_standout_mode
- Strings
- carriage_return
- clear_all_tabs
- clear_margins
- clr_bol
- clr_eol
- clr_eos
- delete_character
- insert_line
- keypad_local
- keypad_xmit
- meta_off
- meta_on
- newline
- orig_pair
- parm_ich
- prtr_off
- prtr_on
- reset_1string
- reset_2string
- scroll_forward
- scroll_reverse
- set_tab
- user7
- user9
- Flags
- auto_right_margin
- can_change
- eat_newline_glitch
- has_meta_key
- no_pad_char
- prtr_silent
- Control
- bell
- tab
- Screen
- clear_screen
- flash_screen
- print_screen
- Parameterized
- change_scroll_region
- column_address
- erase_chars
- parm_dch
- parm_delete_line
- parm_index
- parm_insert_line
- parm_rindex
- row_address
- set_a_background
- set_a_foreground
- set_left_margin_parm
- set_lr_margin
- set_right_margin_parm
- user6
- Cursor
- cursor_address
- cursor_down
- cursor_home
- cursor_invisible
- cursor_left
- cursor_normal
- cursor_right
- cursor_up
- cursor_visible
- parm_down_cursor
- parm_left_cursor
- parm_right_cursor
- parm_up_cursor
- restore_cursor
- save_cursor
- Numeric
- init_tabs
- lines
- max_pairs
#### has_alt_scroll
`ts ignore`
function has_alt_scroll(): boolean;
#### init
Initialize the terminfo database for the specified terminal. If no terminal is
specified, the TERM environment variable is used, defaulting to "xterm" if
not set.
This function MUST be called before any other terminfo functions are used, as it
sets up the necessary terminal capabilities.
Important: If the term parameter is an invalid or unsupported terminal
type, the underlying native implementation will crash the program with an
unhelpful Segmentation Fault error. There is currently no way to catch this
error in JavaScript, so ensure that the terminal type is valid before calling
this.
`ts ignore`
function init(term?: string): Result;
#### info
Retrieve information about the currently initialized terminal.
The returned object contains various details about the configured terminal, such
as its name, dimensions, and supported capabilities. See below for an example of
the returned structure.
`ts ignore`
function info(): Info;
#### termname
`ts ignore`
function termname(): string;
#### longname
`ts ignore`
function longname(): string;
#### baudrate
`ts ignore`
function baudrate(): number;
#### columns
`ts ignore`
function columns(): number;
#### erasechar
`ts ignore`
function erasechar(): number;
#### killchar
`ts ignore`
function killchar(): number;
#### list_supported_terms
`ts ignore`
function list_supported_terms(): string[];
#### has_colors
`ts ignore`
function has_colors(): boolean;
#### num_colors
`ts ignore`
function num_colors(): number;
#### num_pairs
`ts ignore`
function num_pairs(): number;
#### can_change_color
`ts ignore`
function can_change_color(): boolean;
#### color_rgb
`ts ignore`
function color_rgb(i: number): ColorRgb;
#### back_color_erase
screen erased with background color
| terminfo | termcap | human | type |
| -------- | ------- | ------------------ | --------- |
| bce | bce | back_color_erase | boolean |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetflag("bce");
assert.strictEqual(cap, true);
`
#### max_colors
maximum number of colors on screen
| terminfo | termcap | human | type |
| -------- | -------- | ------------ | -------- |
| colors | colors | max_colors | number |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetnum("colors");
assert.strictEqual(cap, 256);
`
#### orig_colors
Set all color pairs to the original ones
| terminfo | termcap | human | type |
| -------- | ------- | ------------- | -------- |
| oc | oc | orig_colors | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("oc");
assert.strictEqual(cap, "\\x1B]104\\007");
`
#### tigetnum
`ts ignore`
function tigetnum(cap: string): number;
#### tigetflag
`ts ignore`
function tigetflag(cap: string): number;
#### tigetstr
`ts ignore`
function tigetstr(cap: string): string;
#### tparm
`ts ignore`
function tparm(cap: string, ...args: number[]): string;
#### sgr
`ts ignore`
function sgr(
bold: booleanish = 0,
underline: booleanish = 0,
blink: booleanish = 0,
reverse: booleanish = 0,
fg: number = -1,
bg: number = -1,
): string;
#### box_char
`ts ignore`
function box_char(style: BoxCharStyle, part: BoxCharPart): string;
#### cap
`ts ignore`
function cap(name: string): string;
#### enable_keyboard
`ts ignore`
function enable_keyboard(): string;
#### disable_keyboard
`ts ignore`
function disable_keyboard(): any;
#### keys
`ts ignore`
function keys(): KeyDef[];
#### keycode
`ts ignore`
function keycode(name: string): number;
#### unctrl
`ts ignore`
function unctrl(input: string): string;
#### resolve_key_code
`ts ignore`
function resolve_key_code(seq: string): number;
#### get_key_count
`ts ignore`
function get_key_count(): number;
#### get_key_modifiers
`ts ignore`
function get_key_modifiers(code: number): number;
#### is_ctrl
`ts ignore`
function is_ctrl(code: number): boolean;
#### is_alt
`ts ignore`
function is_alt(code: number): boolean;
#### is_shift
`ts ignore`
function is_shift(code: number): boolean;
#### key_a1
upper left of keypad
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| ka1 | K1 | key_a1 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("ka1");
assert.strictEqual(cap, "\\x1BOw");
`
#### key_a3
upper right of keypad
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| ka3 | K3 | key_a3 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("ka3");
assert.strictEqual(cap, "\\x1BOy");
`
#### key_b2
center of keypad
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kb2 | K2 | key_b2 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kb2");
assert.strictEqual(cap, "\\x1BOu");
`
#### key_backspace
backspace key
| terminfo | termcap | human | type |
| -------- | ------- | --------------- | -------- |
| kbs | kbs | key_backspace | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kbs");
assert.strictEqual(cap, "^?");
`
#### key_beg
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kbeg | kbeg | key_beg | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kbeg");
assert.strictEqual(cap, "\\x1BOE");
`
#### key_btab
back tab (P)
| terminfo | termcap | human | type |
| -------- | ------- | ---------- | -------- |
| kcbt | bt | key_btab | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kcbt");
assert.strictEqual(cap, "\\x1B[Z");
`
#### key_c1
lower left of keypad
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kc1 | K4 | key_c1 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kc1");
assert.strictEqual(cap, "\\x1BOq");
`
#### key_c3
lower right of keypad
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kc3 | K5 | key_c3 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kc3");
assert.strictEqual(cap, "\\x1BOs");
`
#### key_dc
delete-character key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kdch1 | kD | key_dc | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kdch1");
assert.strictEqual(cap, "\\x1B[3~");
`
#### key_down
down-arrow key
| terminfo | termcap | human | type |
| -------- | ------- | ---------- | -------- |
| kcud1 | kd | key_down | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kcud1");
assert.strictEqual(cap, "\\x1BOB");
`
#### key_end
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kend | kend | key_end | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kend");
assert.strictEqual(cap, "\\x1BOF");
`
#### key_enter
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kent | kent | key_enter | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kent");
assert.strictEqual(cap, "\\x1BOM");
`
#### key_f1
F1 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf1 | k1 | key_f1 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf1");
assert.strictEqual(cap, "\\x1BOP");
`
#### key_f10
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf10 | kf10 | key_f10 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf10");
assert.strictEqual(cap, "\\x1B[21~");
`
#### key_f11
F11 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf11 | kf11 | key_f11 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf11");
assert.strictEqual(cap, "\\x1B[23~");
`
#### key_f12
F12 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf12 | kf12 | key_f12 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf12");
assert.strictEqual(cap, "\\x1B[24~");
`
#### key_f13
F13 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf13 | kf13 | key_f13 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf13");
assert.strictEqual(cap, "\\x1B[1;2P");
`
#### key_f14
F14 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf14 | kf14 | key_f14 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf14");
assert.strictEqual(cap, "\\x1B[1;2Q");
`
#### key_f15
F15 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf15 | kf15 | key_f15 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf15");
assert.strictEqual(cap, "\\x1B[1;2R");
`
#### key_f16
F16 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf16 | kf16 | key_f16 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf16");
assert.strictEqual(cap, "\\x1B[1;2S");
`
#### key_f17
F17 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf17 | kf17 | key_f17 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf17");
assert.strictEqual(cap, "\\x1B[15;2~");
`
#### key_f18
F18 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf18 | kf18 | key_f18 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf18");
assert.strictEqual(cap, "\\x1B[17;2~");
`
#### key_f19
F19 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf19 | kf19 | key_f19 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf19");
assert.strictEqual(cap, "\\x1B[18;2~");
`
#### key_f2
F2 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf2 | k2 | key_f2 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf2");
assert.strictEqual(cap, "\\x1BOQ");
`
#### key_f20
F20 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf20 | kf20 | key_f20 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf20");
assert.strictEqual(cap, "\\x1B[19;2~");
`
#### key_f21
F21 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf21 | kf21 | key_f21 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf21");
assert.strictEqual(cap, "\\x1B[20;2~");
`
#### key_f22
F22 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf22 | kf22 | key_f22 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf22");
assert.strictEqual(cap, "\\x1B[21;2~");
`
#### key_f23
F23 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf23 | kf23 | key_f23 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf23");
assert.strictEqual(cap, "\\x1B[23;2~");
`
#### key_f24
F24 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf24 | kf24 | key_f24 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf24");
assert.strictEqual(cap, "\\x1B[24;2~");
`
#### key_f25
F25 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf25 | kf25 | key_f25 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf25");
assert.strictEqual(cap, "\\x1B[1;5P");
`
#### key_f26
F26 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf26 | kf26 | key_f26 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf26");
assert.strictEqual(cap, "\\x1B[1;5Q");
`
#### key_f27
F27 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf27 | kf27 | key_f27 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf27");
assert.strictEqual(cap, "\\x1B[1;5R");
`
#### key_f28
F28 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf28 | kf28 | key_f28 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf28");
assert.strictEqual(cap, "\\x1B[1;5S");
`
#### key_f29
F29 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf29 | kf29 | key_f29 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf29");
assert.strictEqual(cap, "\\x1B[15;5~");
`
#### key_f3
F3 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf3 | k3 | key_f3 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf3");
assert.strictEqual(cap, "\\x1BOR");
`
#### key_f30
F30 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf30 | kf30 | key_f30 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf30");
assert.strictEqual(cap, "\\x1B[17;5~");
`
#### key_f31
F31 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf31 | kf31 | key_f31 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf31");
assert.strictEqual(cap, "\\x1B[18;5~");
`
#### key_f32
F32 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf32 | kf32 | key_f32 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf32");
assert.strictEqual(cap, "\\x1B[19;5~");
`
#### key_f33
F33 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf33 | kf33 | key_f33 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf33");
assert.strictEqual(cap, "\\x1B[20;5~");
`
#### key_f34
F34 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf34 | kf34 | key_f34 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf34");
assert.strictEqual(cap, "\\x1B[21;5~");
`
#### key_f35
F35 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf35 | kf35 | key_f35 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf35");
assert.strictEqual(cap, "\\x1B[23;5~");
`
#### key_f36
F36 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf36 | kf36 | key_f36 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf36");
assert.strictEqual(cap, "\\x1B[24;5~");
`
#### key_f37
F37 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf37 | kf37 | key_f37 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf37");
assert.strictEqual(cap, "\\x1B[1;6P");
`
#### key_f38
F38 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf38 | kf38 | key_f38 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf38");
assert.strictEqual(cap, "\\x1B[1;6Q");
`
#### key_f39
F39 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf39 | kf39 | key_f39 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf39");
assert.strictEqual(cap, "\\x1B[1;6R");
`
#### key_f4
F4 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf4 | k4 | key_f4 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf4");
assert.strictEqual(cap, "\\x1BOS");
`
#### key_f40
F40 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf40 | kf40 | key_f40 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf40");
assert.strictEqual(cap, "\\x1B[1;6S");
`
#### key_f41
F41 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf41 | kf41 | key_f41 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf41");
assert.strictEqual(cap, "\\x1B[15;6~");
`
#### key_f42
F42 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf42 | kf42 | key_f42 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf42");
assert.strictEqual(cap, "\\x1B[17;6~");
`
#### key_f43
F43 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf43 | kf43 | key_f43 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf43");
assert.strictEqual(cap, "\\x1B[18;6~");
`
#### key_f44
F44 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf44 | kf44 | key_f44 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf44");
assert.strictEqual(cap, "\\x1B[19;6~");
`
#### key_f45
F45 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf45 | kf45 | key_f45 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf45");
assert.strictEqual(cap, "\\x1B[20;6~");
`
#### key_f46
F46 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf46 | kf46 | key_f46 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf46");
assert.strictEqual(cap, "\\x1B[21;6~");
`
#### key_f47
F47 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf47 | kf47 | key_f47 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf47");
assert.strictEqual(cap, "\\x1B[23;6~");
`
#### key_f48
F48 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf48 | kf48 | key_f48 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf48");
assert.strictEqual(cap, "\\x1B[24;6~");
`
#### key_f49
F49 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf49 | kf49 | key_f49 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf49");
assert.strictEqual(cap, "\\x1B[1;3P");
`
#### key_f5
F5 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf5 | k5 | key_f5 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf5");
assert.strictEqual(cap, "\\x1B[15~");
`
#### key_f50
F50 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf50 | kf50 | key_f50 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf50");
assert.strictEqual(cap, "\\x1B[1;3Q");
`
#### key_f51
F51 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf51 | kf51 | key_f51 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf51");
assert.strictEqual(cap, "\\x1B[1;3R");
`
#### key_f52
F52 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf52 | kf52 | key_f52 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf52");
assert.strictEqual(cap, "\\x1B[1;3S");
`
#### key_f53
F53 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf53 | kf53 | key_f53 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf53");
assert.strictEqual(cap, "\\x1B[15;3~");
`
#### key_f54
F54 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf54 | kf54 | key_f54 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf54");
assert.strictEqual(cap, "\\x1B[17;3~");
`
#### key_f55
F55 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf55 | kf55 | key_f55 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf55");
assert.strictEqual(cap, "\\x1B[18;3~");
`
#### key_f56
F56 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf56 | kf56 | key_f56 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf56");
assert.strictEqual(cap, "\\x1B[19;3~");
`
#### key_f57
F57 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf57 | kf57 | key_f57 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf57");
assert.strictEqual(cap, "\\x1B[20;3~");
`
#### key_f58
F58 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf58 | kf58 | key_f58 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf58");
assert.strictEqual(cap, "\\x1B[21;3~");
`
#### key_f59
F59 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf59 | kf59 | key_f59 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf59");
assert.strictEqual(cap, "\\x1B[23;3~");
`
#### key_f6
F6 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf6 | k6 | key_f6 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf6");
assert.strictEqual(cap, "\\x1B[17~");
`
#### key_f60
F60 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf60 | kf60 | key_f60 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf60");
assert.strictEqual(cap, "\\x1B[24;3~");
`
#### key_f61
F61 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf61 | kf61 | key_f61 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf61");
assert.strictEqual(cap, "\\x1B[1;4P");
`
#### key_f62
F62 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf62 | kf62 | key_f62 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf62");
assert.strictEqual(cap, "\\x1B[1;4Q");
`
#### key_f63
F63 function key
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kf63 | kf63 | key_f63 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf63");
assert.strictEqual(cap, "\\x1B[1;4R");
`
#### key_f7
F7 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf7 | k7 | key_f7 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf7");
assert.strictEqual(cap, "\\x1B[18~");
`
#### key_f8
F8 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf8 | k8 | key_f8 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf8");
assert.strictEqual(cap, "\\x1B[19~");
`
#### key_f9
F9 function key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kf9 | k9 | key_f9 | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kf9");
assert.strictEqual(cap, "\\x1B[20~");
`
#### key_home
home key
| terminfo | termcap | human | type |
| -------- | ------- | ---------- | -------- |
| khome | kh | key_home | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("khome");
assert.strictEqual(cap, "\\x1BOH");
`
#### key_ic
insert-character key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kich1 | kI | key_ic | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kich1");
assert.strictEqual(cap, "\\x1B[2~");
`
#### key_left
left-arrow key
| terminfo | termcap | human | type |
| -------- | ------- | ---------- | -------- |
| kcub1 | kl | key_left | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kcub1");
assert.strictEqual(cap, "\\x1BOD");
`
#### key_npage
next-page key
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| knp | kN | key_npage | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("knp");
assert.strictEqual(cap, "\\x1B[6~");
`
#### key_ppage
previous-page key
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kpp | kP | key_ppage | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kpp");
assert.strictEqual(cap, "\\x1B[5~");
`
#### key_right
right-arrow key
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kcuf1 | kr | key_right | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kcuf1");
assert.strictEqual(cap, "\\x1BOC");
`
#### key_sdc
Represents the Shift+dc key combination.
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kDC | kDC | key_sdc | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kDC");
assert.strictEqual(cap, "\\x1B[3;2~");
`
#### key_send
Represents the Shift+end key combination.
| terminfo | termcap | human | type |
| -------- | ------- | ---------- | -------- |
| kEND | kEND | key_send | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kEND");
assert.strictEqual(cap, "\\x1B[1;2F");
`
#### key_sf
scroll-forward key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kind | kind | key_sf | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kind");
assert.strictEqual(cap, "\\x1B[1;2B");
`
#### key_shome
Represents the Shift+home key combination.
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kHOM | kHOM | key_shome | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kHOM");
assert.strictEqual(cap, "\\x1B[1;2H");
`
#### key_sic
Represents the Shift+ic key combination.
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| kIC | kIC | key_sic | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kIC");
assert.strictEqual(cap, "\\x1B[2;2~");
`
#### key_sleft
Represents the Shift+left key combination.
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kLFT | kLFT | key_sleft | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kLFT");
assert.strictEqual(cap, "\\x1B[1;2D");
`
#### key_snext
Represents the Shift+npage key combination.
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kNXT | kNXT | key_snext | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kNXT");
assert.strictEqual(cap, "\\x1B[6;2~");
`
#### key_sprevious
Represents the Shift+ppage key combination.
| terminfo | termcap | human | type |
| -------- | ------- | --------------- | -------- |
| kPRV | kPRV | key_sprevious | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kPRV");
assert.strictEqual(cap, "\\x1B[5;2~");
`
#### key_sr
scroll-backward key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kri | kri | key_sr | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kri");
assert.strictEqual(cap, "\\x1B[1;2A");
`
#### key_sright
Represents the Shift+right key combination.
| terminfo | termcap | human | type |
| -------- | ------- | ------------ | -------- |
| kRIT | kRIT | key_sright | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kRIT");
assert.strictEqual(cap, "\\x1B[1;2C");
`
#### key_up
up-arrow key
| terminfo | termcap | human | type |
| -------- | ------- | -------- | -------- |
| kcuu1 | ku | key_up | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kcuu1");
assert.strictEqual(cap, "\\x1BOA");
`
#### stdin_fd
`ts ignore`
function stdin_fd(): number;
#### stdout_fd
`ts ignore`
function stdout_fd(): number;
#### stderr_fd
`ts ignore`
function stderr_fd(): number;
#### isatty
`ts ignore`
function isatty(fd: number): boolean;
#### tcgetattr
`ts ignore`
function tcgetattr(fd?: number): Termios;
#### tcsetattr
`ts ignore`
function tcsetattr(termios_p: Partial
#### tcflush
`ts ignore`
function tcflush(fd: number, queue?: number): void;
#### get_termios
`ts ignore`
function get_termios(fd?: number): Termios;
#### set_termios
`ts ignore`
function set_termios(termios: Partial
#### get_termios_constants
`ts ignore`
function get_termios_constants(): TermiosConstants;
#### is_terminal_raw
`ts ignore`
function is_terminal_raw(): boolean;
#### is_terminal_cbreak
`ts ignore`
function is_terminal_cbreak(): boolean;
#### is_terminal_normal
`ts ignore`
function is_terminal_normal(): boolean;
#### enter_raw_mode
`ts ignore`
function enter_raw_mode(): Result;
#### enter_cbreak_mode
`ts ignore`
function enter_cbreak_mode(): Result;
#### exit_raw_mode
`ts ignore`
function exit_raw_mode(): Result;
#### exit_cbreak_mode
`ts ignore`
function exit_cbreak_mode(): Result;
#### restore
`ts ignore`
function restore(): Result;
#### enter_normal_mode
`ts ignore`
function enter_normal_mode(): Result;
#### request_mode_status
`ts ignore`
function request_mode_status(
mode: number,
dec?: booleanish,
): ModeStatus;
#### is_mode_supported
`ts ignore`
function is_mode_supported(mode: number, dec?: booleanish): boolean;
#### is_mode_settable
`ts ignore`
function is_mode_settable(mode: number, dec?: booleanish): boolean;
#### is_mode_enabled
`ts ignore`
function is_mode_enabled(mode: number, dec?: booleanish): boolean;
#### is_mode_disabled
`ts ignore`
function is_mode_disabled(mode: number, dec?: booleanish): boolean;
#### is_mode_permanent
`ts ignore`
function is_mode_permanent(mode: number, dec?: booleanish): boolean;
#### has_alt_screen
`ts ignore`
function has_alt_screen(): boolean;
#### has_bracketed_paste
`ts ignore`
function has_bracketed_paste(): boolean;
#### has_button_events
`ts ignore`
function has_button_events(): boolean;
#### has_motion_events
`ts ignore`
function has_motion_events(): boolean;
#### has_focus_events
`ts ignore`
function has_focus_events(): boolean;
#### has_mouse_support
`ts ignore`
function has_mouse_support(): boolean;
#### has_mouse_events
`ts ignore`
function has_mouse_events(): boolean;
#### has_x10_mouse
`ts ignore`
function has_x10_mouse(): boolean;
#### has_vt200_mouse
`ts ignore`
function has_vt200_mouse(): boolean;
#### has_highlight_mouse
`ts ignore`
function has_highlight_mouse(): boolean;
#### has_utf8_mouse
`ts ignore`
function has_utf8_mouse(): boolean;
#### has_sgr_mouse
`ts ignore`
function has_sgr_mouse(): boolean;
#### has_urxvt_mouse
`ts ignore`
function has_urxvt_mouse(): boolean;
#### has_pixel_mouse
`ts ignore`
function has_pixel_mouse(): boolean;
#### has_mouse
`ts ignore`
function has_mouse(): boolean;
#### enable_mouse
`ts ignore`
function enable_mouse(): string;
#### disable_mouse
`ts ignore`
function disable_mouse(): string;
#### parse_mouse
`ts ignore`
function parse_mouse(
seq: string,
protocol: MouseProtocol | undefined,
): MouseParsed | undefined;
#### get_mouse_x
`ts ignore`
function get_mouse_x(): number;
#### get_mouse_y
`ts ignore`
function get_mouse_y(): number;
#### get_mouse_button
`ts ignore`
function get_mouse_button(): number;
#### get_mouse_action
`ts ignore`
function get_mouse_action(): number;
#### get_mouse_modifiers
`ts ignore`
function get_mouse_modifiers(): number;
#### key_mouse
| terminfo | termcap | human | type |
| -------- | ------- | ----------- | -------- |
| kmous | kmous | key_mouse | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("kmous");
assert.strictEqual(cap, "\\x1B[<");
`
#### enter_alt_charset_mode
start alternate character set (P)
| terminfo | termcap | human | type |
| -------- | ------- | ------------------------ | -------- |
| smacs | as | enter_alt_charset_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smacs");
assert.strictEqual(cap, "\\x1B(0");
`
#### enter_am_mode
turn on automatic margins
| terminfo | termcap | human | type |
| -------- | ------- | --------------- | -------- |
| smam | smam | enter_am_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smam");
assert.strictEqual(cap, "\\x1B[?7h");
`
#### enter_blink_mode
turn on blinking
| terminfo | termcap | human | type |
| -------- | ------- | ------------------ | -------- |
| blink | mb | enter_blink_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("blink");
assert.strictEqual(cap, "\\x1B[5m");
`
#### enter_bold_mode
turn on bold (extra bright) mode
| terminfo | termcap | human | type |
| -------- | ------- | ----------------- | -------- |
| bold | md | enter_bold_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("bold");
assert.strictEqual(cap, "\\x1B[1m");
`
#### enter_ca_mode
string to start programs using cup
| terminfo | termcap | human | type |
| -------- | ------- | --------------- | -------- |
| smcup | ti | enter_ca_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smcup");
assert.strictEqual(cap, "\\x1B[?1049h\\x1B[22;0;0t");
`
#### enter_dim_mode
turn on half-bright mode
| terminfo | termcap | human | type |
| -------- | ------- | ---------------- | -------- |
| dim | mh | enter_dim_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("dim");
assert.strictEqual(cap, "\\x1B[2m");
`
#### enter_insert_mode
enter insert mode
| terminfo | termcap | human | type |
| -------- | ------- | ------------------- | -------- |
| smir | im | enter_insert_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smir");
assert.strictEqual(cap, "\\x1B[4h");
`
#### enter_italics_mode
Enter italic mode
| terminfo | termcap | human | type |
| -------- | ------- | -------------------- | -------- |
| sitm | sitm | enter_italics_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("sitm");
assert.strictEqual(cap, "\\x1B[3m");
`
#### enter_reverse_mode
turn on reverse video mode
| terminfo | termcap | human | type |
| -------- | ------- | -------------------- | -------- |
| rev | rev | enter_reverse_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rev");
assert.strictEqual(cap, "\\x1B[7m");
`
#### enter_secure_mode
turn on blank mode (characters invisible)
| terminfo | termcap | human | type |
| -------- | ------- | ------------------- | -------- |
| invis | invis | enter_secure_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("invis");
assert.strictEqual(cap, "\\x1B[8m");
`
#### enter_standout_mode
begin standout mode
| terminfo | termcap | human | type |
| -------- | ------- | --------------------- | -------- |
| smso | smso | enter_standout_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smso");
assert.strictEqual(cap, "\\x1B[7m");
`
#### enter_underline_mode
begin underline mode
| terminfo | termcap | human | type |
| -------- | ------- | ---------------------- | -------- |
| smul | us | enter_underline_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("smul");
assert.strictEqual(cap, "\\x1B[4m");
`
#### exit_alt_charset_mode
end alternate character set (P)
| terminfo | termcap | human | type |
| -------- | ------- | ----------------------- | -------- |
| rmacs | ae | exit_alt_charset_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmacs");
assert.strictEqual(cap, "\\x1B(B");
`
#### exit_am_mode
turn off automatic margins
| terminfo | termcap | human | type |
| -------- | ------- | -------------- | -------- |
| rmam | rmam | exit_am_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmam");
assert.strictEqual(cap, "\\x1B[?7l");
`
#### exit_attribute_mode
turn off all attributes
| terminfo | termcap | human | type |
| -------- | ------- | --------------------- | -------- |
| sgr0 | sgr0 | exit_attribute_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("sgr0");
assert.strictEqual(cap, "\\x1B(B\\x1B[m");
`
#### exit_ca_mode
strings to end programs using cup
| terminfo | termcap | human | type |
| -------- | ------- | -------------- | -------- |
| rmcup | te | exit_ca_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmcup");
assert.strictEqual(cap, "\\x1B[?1049l\\x1B[23;0;0t");
`
#### exit_insert_mode
exit insert mode
| terminfo | termcap | human | type |
| -------- | ------- | ------------------ | -------- |
| rmir | ei | exit_insert_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmir");
assert.strictEqual(cap, "\\x1B[4l");
`
#### exit_italics_mode
End italic mode
| terminfo | termcap | human | type |
| -------- | ------- | ------------------- | -------- |
| ritm | ritm | exit_italics_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("ritm");
assert.strictEqual(cap, "\\x1B[23m");
`
#### exit_standout_mode
exit standout mode
| terminfo | termcap | human | type |
| -------- | ------- | -------------------- | -------- |
| rmso | se | exit_standout_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmso");
assert.strictEqual(cap, "\\x1B[27m");
`
#### exit_underline_mode
exit underline mode
| terminfo | termcap | human | type |
| -------- | ------- | --------------------- | -------- |
| rmul | ue | exit_underline_mode | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("rmul");
assert.strictEqual(cap, "\\x1B[24m");
`
#### move_insert_mode
safe to move while in insert mode
| terminfo | termcap | human | type |
| -------- | ------- | ------------------ | --------- |
| mir | mir | move_insert_mode | boolean |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetflag("mir");
assert.strictEqual(cap, true);
`
#### move_standout_mode
safe to move while in standout mode
| terminfo | termcap | human | type |
| -------- | ------- | -------------------- | --------- |
| msgr | msgr | move_standout_mode | boolean |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetflag("msgr");
assert.strictEqual(cap, true);
`
#### carriage_return
carriage return (P) (P)
| terminfo | termcap | human | type |
| -------- | ------- | ----------------- | -------- |
| cr | cr | carriage_return | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("cr");
assert.strictEqual(cap, "\\r");
`
#### clear_all_tabs
clear all tab stops (P)
| terminfo | termcap | human | type |
| -------- | ------- | ---------------- | -------- |
| tbc | ct | clear_all_tabs | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("tbc");
assert.strictEqual(cap, "\\x1B[3g");
`
#### clear_margins
clear right and left soft margins
| terminfo | termcap | human | type |
| -------- | ------- | --------------- | -------- |
| mgc | mgc | clear_margins | string |
`ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
const cap = ti.tigetstr("mgc");
assert.strictEqual(cap, "\\x1B[?69l");
`
#### clr_bol
Clear to beginning of line
| terminfo | termcap | human | type |
| -------- | ------- | --------- | -------- |
| el1 | el1 | clr_bol | string |
``ts
import ti from "terminfo.node";
import assert from "node:assert";
ti.init("xterm-256color");
co