Module terminal.cursor.shape
Terminal cursor shape module.
Provides utilities for cursor shape handling in terminals.
Functions
| set (shape) | Sets the cursor shape and writes it to the terminal. |
Sequences
| set_seq (shape) | Returns the ansi sequence for a cursor shape without writing it to the terminal. |
Stack based functions
| apply () | Re-applies the shape at the top of the stack, and writes it to the terminal. |
| apply_seq () | Re-applies the shape at the top of the stack (returns it, does not write it to the terminal). |
| pop ([n=1]) | Pops n cursor shape(s) off the stack, and writes the last one 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 (s) | Pushes a cursor shape onto the stack, and writes it to the terminal. |
| push_seq (s) | Pushes a cursor shape onto the stack (and returns it), without writing it to the terminal. |
Functions
- set (shape)
-
Sets the cursor shape and writes it to the terminal.
Parameters:
- shape
string
the shape to set, one of the keys
"block","block_blink","underline","underline_blink","bar","bar_blink"
Returns:
-
true
- shape
string
the shape to set, one of the keys
Sequences
- set_seq (shape)
-
Returns the ansi sequence for a cursor shape without writing it to the terminal.
Parameters:
- shape
string
the shape to get, one of the keys
"block","block_blink","underline","underline_blink","bar","bar_blink"
Returns:
-
string
ansi sequence to write to the terminal
- shape
string
the shape to get, one of the keys
Stack based functions
These functions provide direct access to the cursor position stack.
- apply ()
-
Re-applies the shape at the top of the stack, and writes it to the terminal.
Returns:
-
true
- 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 ([n=1])
-
Pops
ncursor 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
- pop_seq ([n=1])
-
Pops
ncursor 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 (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
- s
string
the shape to push, one of the keys
- 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
- s
string
the shape to push, one of the keys