Module terminal.cursor.shape.stack

Cursor shape stack.

Managing the shape of the cursor based on a stack. Since the current shape cannot be requested, using stacks allows the user to revert to a previous state since the stacks keeps track of that. It does however require the user to use balanced operations; push/pop.

Functions

apply () Re-applies the shape at the top of the stack, and writes it to the terminal.
pop ([n=1]) Pops n cursor shape(s) off the stack, and writes the last one to the terminal.
push (s) Pushes a cursor shape onto the stack, and writes it to the terminal.

Sequences

apply_seq () Re-applies the shape at the top of the stack (returns it, does not write it to the terminal).
pop_seq ([n=1]) Pops n cursor shape(s) off the stack (and returns the last one), without writing it to the terminal.
push_seq (s) Pushes a cursor shape onto the stack (and returns it), without writing it to the terminal.


Functions

apply ()
Re-applies the shape at the top of the stack, and writes it to the terminal.

Returns:

    true
pop ([n=1])
Pops n cursor shape(s) off the stack, and writes the last one to the terminal.

Parameters:

  • n number number of shapes to pop (default 1)

Returns:

    true
push (s)
Pushes a cursor shape onto the stack, and writes it to the terminal.

Parameters:

  • s string the shape to push, one of the keys "block", "block_blink", "underline", "underline_blink", "bar", "bar_blink"

Returns:

    true

Sequences

apply_seq ()
Re-applies the shape at the top of the stack (returns it, does not write it to the terminal).

Returns:

    string ansi sequence to write to the terminal
pop_seq ([n=1])
Pops n cursor shape(s) off the stack (and returns the last one), without writing it to the terminal.

Parameters:

  • n number number of shapes to pop (default 1)

Returns:

    string ansi sequence to write to the terminal
push_seq (s)
Pushes a cursor shape onto the stack (and returns it), without writing it to the terminal.

Parameters:

  • s string the shape to push, one of the keys "block", "block_blink", "underline", "underline_blink", "bar", "bar_blink"

Returns:

    string ansi sequence to write to the terminal
generated by LDoc 1.5.0