term

Members

(static) CANONICAL :number

Source:

Canonical terminal mode

Type:
  • number

(static) PASSWORD :number

Source:
Default Value:
  • 1

Password (canonical without echo) terminal mode

Type:
  • number

(static) RAW :number

Source:
Default Value:
  • 2

Raw terminal mode

Type:
  • number

Methods

(static) bg(r, g, b) → {void}

Source:

Set text background color to RGB value

Parameters:
Name Type Description
r number

Red value

g number

Green value

b number

Blue value

Throws:
Returns:
Type
void

(static) clear() → {void}

Source:

Clear terminal screen and move cursor to (1, 1)

Throws:
Returns:
Type
void

(static) fg(r, g, b) → {void}

Source:

Set text foreground color to RGB value

Parameters:
Name Type Description
r number

Red value

g number

Green value

b number

Blue value

Throws:
Returns:
Type
void

(static) hide_cursor() → {void}

Source:

Hide cursor

Throws:
Returns:
Type
void

(static) move_to(row, column) → {void}

Source:

Move cursor to coordinate

Parameters:
Name Type Description
row number

Row (starting at 1)

column number

Column (starting at 1)

Throws:
Returns:
Type
void

(static) print(…items) → {void}

Source:

Print one or more items to stdout

Parameters:
Name Type Attributes Description
items * <repeatable>

Items to print

Throws:
Returns:
Type
void

(static) print2(…items) → {void}

Source:

Print one or more items to stderr

Parameters:
Name Type Attributes Description
items * <repeatable>

Items to print

Throws:
Returns:
Type
void

(static) println(…items) → {void}

Source:

Print one or more items to stdout, then append a line feed

Parameters:
Name Type Attributes Description
items * <repeatable>

Items to print

Throws:
Returns:
Type
void

(static) println2(…items) → {void}

Source:

Print one or more items to stderr, then append a line feed

Parameters:
Name Type Attributes Description
items * <repeatable>

Items to print

Throws:
Returns:
Type
void

(static) read_line() → {string}

Source:

Read a line of text from stdin.

Note that this method uses an underlying stream to make readings more efficient.

Throws:
Returns:

A line or null on EOF

Type
string

(static) reset() → {void}

Source:

Reset terminal to default values (foreground and background color, etc.)

Throws:
Returns:
Type
void

(static) set_mode(mode) → {void}

Source:

Set terminal mode to canonnical, password or raw.

Parameters:
Name Type Description
mode number

One of {link module:term.CANONICAL}, {link module:term.PASSWORD} and {link module:term.RAW} constants.

Throws:
Returns:
Type
void

(static) show_cursor() → {void}

Source:

Make cursor visible

Throws:
Returns:
Type
void

(static) to_string(thing) → {string}

Source:

Return a string representation of an item

Parameters:
Name Type Description
thing *

The item

Throws:
Returns:

The string representation of the item

Type
string