Module terminal.clear

Module for clearing (parts of) the screen.

Provides functions to clear various parts of the terminal screen.

Functions

bol () Clears from cursor to begin of the line (BOL) and writes to the terminal.
bottom () Clears the screen from the cursor position to the bottom-right and writes to the terminal.
box (height, width) Clears a box and writes it to the terminal.
eol () Clears from cursor to end of the line (EOL) and writes to the terminal.
line () Clears the current line and writes to the terminal.
screen () Clears the entire screen by writing the ANSI sequence to the terminal.
top () Clears the screen from the cursor position to the top-left and writes to the terminal.

Sequences

bol_seq () Creates an ANSI sequence to clear from cursor to begin of the line (BOL) without writing.
bottom_seq () Creates an ANSI sequence to clear the screen from cursor to bottom-right without writing.
box_seq (height, width) Creates an ANSI sequence to clear a box without writing.
eol_seq () Creates an ANSI sequence to clear from cursor to end of the line (EOL) without writing.
line_seq () Creates an ANSI sequence to clear the current line without writing.
screen_seq () Creates an ANSI sequence to clear the entire screen without writing it to the terminal.
top_seq () Creates an ANSI sequence to clear the screen from cursor to top-left without writing.


Functions

bol ()
Clears from cursor to begin of the line (BOL) and writes to the terminal.

Returns:

    true Always returns true after clearing.
bottom ()
Clears the screen from the cursor position to the bottom-right and writes to the terminal.

Returns:

    true Always returns true after clearing.
box (height, width)
Clears a box and writes it to the terminal. The sequence starts at the current cursor position, and returns the cursor there. If either height or width is less than 1, the function writes an empty string.

Parameters:

  • height number The height of the box to clear.
  • width number The width of the box to clear.

Returns:

    true Always returns true after clearing.
eol ()
Clears from cursor to end of the line (EOL) and writes to the terminal.

Returns:

    true Always returns true after clearing.
line ()
Clears the current line and writes to the terminal.

Returns:

    true Always returns true after clearing.
screen ()
Clears the entire screen by writing the ANSI sequence to the terminal.

Returns:

    true Always returns true after clearing.
top ()
Clears the screen from the cursor position to the top-left and writes to the terminal.

Returns:

    true Always returns true after clearing.

Sequences

bol_seq ()
Creates an ANSI sequence to clear from cursor to begin of the line (BOL) without writing.

Returns:

    string The ANSI sequence for clearing to the start of the line.
bottom_seq ()
Creates an ANSI sequence to clear the screen from cursor to bottom-right without writing.

Returns:

    string The ANSI sequence for clearing to the bottom.
box_seq (height, width)
Creates an ANSI sequence to clear a box without writing. The sequence starts at the current cursor position, and returns the cursor there. If either height or width is less than 1, the function returns an empty string.

Parameters:

  • height number The height of the box to clear.
  • width number The width of the box to clear.

Returns:

    string The ANSI sequence for clearing the box.
eol_seq ()
Creates an ANSI sequence to clear from cursor to end of the line (EOL) without writing.

Returns:

    string The ANSI sequence for clearing to the end of the line.
line_seq ()
Creates an ANSI sequence to clear the current line without writing.

Returns:

    string The ANSI sequence for clearing the entire line.
screen_seq ()
Creates an ANSI sequence to clear the entire screen without writing it to the terminal.

Returns:

    string The ANSI sequence for clearing the entire screen.
top_seq ()
Creates an ANSI sequence to clear the screen from cursor to top-left without writing.

Returns:

    string The ANSI sequence for clearing to the top.
generated by LDoc 1.5.0