Module terminal.cursor.visible.stack
Cursor visibility stack.
Managing the visibility of the cursor based on a stack. Since the current visibility 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 () | Returns the ansi sequence to show/hide the cursor at the top of the stack, and writes it to the terminal. |
pop ([n=1]) | Pops n cursor visibility(ies) off the stack, and writes the last one to the terminal. |
push ([v=true]) | Pushes a cursor visibility onto the stack, and writes it to the terminal. |
Sequences
apply_seq () | Returns the ansi sequence to show/hide the cursor at the top of the stack without writing it to the terminal. |
pop_seq ([n=1]) | Pops n cursor visibility(ies) off the stack (and returns the last one), without writing it to the terminal. |
push_seq ([v=true]) | Pushes a cursor visibility onto the stack (and returns it), without writing it to the terminal. |
Functions
- apply ()
-
Returns the ansi sequence to show/hide the cursor at the top of the stack, and writes it to the terminal.
Returns:
-
true
- pop ([n=1])
-
Pops
n
cursor visibility(ies) off the stack, and writes the last one to the terminal.Parameters:
- n number number of visibilities to pop (default 1)
Returns:
-
true
- push ([v=true])
-
Pushes a cursor visibility onto the stack, and writes it to the terminal.
Parameters:
- v boolean true to show, false to hide (default true)
Returns:
-
true
Sequences
- apply_seq ()
-
Returns the ansi sequence to show/hide the cursor at the top of the stack without writing it to the terminal.
Returns:
-
string
ansi sequence to write to the terminal
- pop_seq ([n=1])
-
Pops
n
cursor visibility(ies) off the stack (and returns the last one), without writing it to the terminal.Parameters:
- n number number of visibilities to pop (default 1)
Returns:
-
string
ansi sequence to write to the terminal
- push_seq ([v=true])
-
Pushes a cursor visibility onto the stack (and returns it), without writing it to the terminal.
Parameters:
- v boolean true to show, false to hide (default true)
Returns:
-
string
ansi sequence to write to the terminal