termlib library
Dart library that provides a set of utilities for terminal applications. Provides information about the running terminal as well as a set of methods for styling the text output or interacting with the terminal.
Classes
- Color
- Color class
- Style
- Represents a text string that could have some properties as color and text styles.
- TermLib
- Terminal library
- TermRunner
- Helper for setting up and tearing down terminal state.
Enums
- Clipboard
- Clipboard to use
- ClipboardMode
- Clipboard Operation Modes
- ColorKind
- Color kind
- ProfileEnum
- Enumeration representing different profiles.
- TextStyle
- Text Styles that can be applied to a Style object.
Extensions
- CursorUtils on TermLib
- Cursor handling functions
- EraseUtils on TermLib
- Eraser handling functions
- TermUtils on TermLib
- Support function that add some extra features to the terminal.
Constants
- defaultQueryTimeout → const int
- Default timeout to wait for terminal query responses.
Typedefs
-
AppRunner
= FutureOr<
int> Function(TermLib term) - App runner function type. Returns exit code.
-
CleanupCallback
= FutureOr<
void> Function(TermLib term) - Cleanup callback type. Called before exit on all paths (normal, error, signal).
-
EnvironmentData
= Map<
String, String> - Type similar to Platform.environment, used for dependency injection
-
ErrorHandler
= FutureOr<
int> Function(TermLib term, Object error, StackTrace stack) - Error handler callback type.
-
ExitCallback
= Future<
void> Function(TermLib term, int exitCode) -
Exit callback type for testing. Replaces
flushThenExit. - Pos = ({int col, int row})
- Record that represent a coordinate position