Terminal API
The wijjit.terminal package abstracts ANSI escapes, screen buffers, keyboard/mouse input, and cursor control. Use these classes when building custom renderers or writing low-level tests.
ANSI helpers
ANSI color codes for text and background. |
|
ANSI text styling codes. |
|
ANSI cursor control codes. |
|
ANSI screen control codes. |
|
Get the visible display width of text (excluding ANSI codes). |
|
Wrap a single line of text into multiple segments based on width. |
|
Clip text to specified width, preserving ANSI codes. |
|
Remove all ANSI escape sequences from text. |
|
Apply ANSI colors and styles to text. |
Input & mouse
Type of key press. |
|
Represents a keyboard key press. |
|
Common keyboard key definitions. |
|
Handles reading and parsing keyboard and mouse input using prompt_toolkit. |
|
Represents a mouse event. |
|
Types of mouse events. |
|
Mouse button identifiers. |
|
Mouse tracking modes for ANSI terminals. |
|
Parser for ANSI mouse event sequences. |
Screen & buffers
Manages terminal screen state and alternate buffer. |
|
Context manager for alternate screen buffer. |
|
A single terminal cell with character and styling attributes. |
|
Pool of pre-allocated common Cell objects for performance. |
|
2D buffer of terminal cells with dirty region tracking. |
|
Efficiently renders changes between two buffers. |