terminal package
This library implements a system for processing human readable text that will be output by console applications.
Remarks
See the TerminalWritable documentation for an overview of the major concepts.
Classes
Class | Description |
|---|---|
Operations for working with text strings that contain ANSI escape codes. The most commonly used escape codes set the foreground/background color for console output. | |
This class enables very basic TerminalWritable.onWriteChunk() operations to be implemented as a callback function, avoiding the need to define a subclass of | |
The static functions on this class are used to produce colored text for use with a terminal that supports ANSI escape codes. Note that this API always generates color codes, regardless of whether the process's stdout is a TTY. The reason is that, in a complex program, the code that is generating strings often does not know were those strings will end up. In some cases, the same log message may get printed both to a shell that supports color AND to a log file that does not. | |
(BETA) Terminal provider that prints to STDOUT (for log- and verbose-level messages) and STDERR (for warning- and error-level messages). | |
(BETA) | |
(BETA) A TerminalWritable subclass for use by unit tests. | |
(BETA) Terminal provider that stores written data in buffers separated by severity. This terminal provider is designed to be used when code that prints to a terminal is being unit tested. | |
For use with TextRewriterTransform, this rewriter converts all newlines to a standard format. | |
(BETA) Wraps an existing ITerminalProvider that prefixes each line of output with a specified prefix string. | |
A collection of utilities for printing messages to the console. | |
(BETA) A TerminalWritable that consumes line-oriented terminal output and extracts structured problems using one or more IProblemMatcher instances. | |
For use with TextRewriterTransform, this rewriter removes ANSI escape codes including colored text. | |
Use this instead of TerminalTransform if you need to output | |
(BETA) | |
(BETA) Summarizes the results of a failed build task by returning a subset of | |
A TerminalWritable subclass that writes its output directly to the process | |
(BETA) Terminal provider that stores written data in buffers separated by severity. This terminal provider is designed to be used when code that prints to a terminal is being unit tested. | |
(BETA) This class facilitates writing to a console. | |
(BETA) A adapter to allow writing to a provided terminal using Writable streams. | |
A TerminalTransform subclass that performs one or more TextRewriter operations. The most common operations are NormalizeNewlinesTextRewriter and RemoveColorsTextRewriter. |
Abstract Classes
Abstract Class | Description |
|---|---|
The abstract base class for TerminalWritable objects that receive an input, transform it somehow, and then write the output to another | |
The abstract base class for objects that can present, route, or process text output for a console application. This output is typically prepared using the Terminal API. | |
The abstract base class for operations that can be applied by TextRewriterTransform. |
Enumerations
Enumeration | Description |
|---|---|
Specifies the kind of data represented by a ITerminalChunk object. | |
(BETA) Similar to many popular logging packages, terminal providers support a range of message severities. These severities have built-in formatting defaults in the Terminal object (warnings are yellow, errors are red, etc.). Terminal providers may choose to suppress certain messages based on their severity, or to route some messages to other providers or not based on severity. Severity | Purpose --------- | ------- error | Build errors and fatal issues warning | Not necessarily fatal, but indicate a problem the user should fix log | Informational messages verbose | Additional information that may not always be necessary debug | Highest detail level, best used for troubleshooting information |
Interfaces
Interface | Description |
|---|---|
(BETA) | |
Options for AnsiEscape.formatForTests(). | |
Constructor options for CallbackWritable. | |
(BETA) Options to be provided to a ConsoleTerminalProvider | |
(BETA) Constructor options for DiscardStdoutTransform | |
(BETA) Options for PrefixProxyTerminalProvider. | |
Constructor options for NormalizeNewlinesTextRewriter | |
(BETA) | |
(BETA) | |
(BETA) Collects problems (errors/warnings/info) encountered during an operation. | |
(BETA) Constructor options for ProblemCollector. | |
Constructor options for SplitterTransform. | |
(BETA) Options for PrefixProxyTerminalProvider, with a static prefix. | |
(BETA) Constructor options for StderrLineTransform | |
(BETA) Constructor options for StdioSummarizer. | |
(BETA) | |
(BETA) | |
(BETA) | |
Represents a chunk of output that will ultimately be written to a TerminalWritable. | |
(BETA) Implement the interface to create a terminal provider. Terminal providers can be registered to a Terminal instance to receive messages. | |
(BETA) Options for TerminalStreamWritable. | |
Constructor options for TerminalTransform. | |
Constructor options for TerminalWritable | |
(BETA) | |
Constructor options for TextRewriterTransform. |
Variables
Variable | Description |
|---|---|
A sensible fallback column width for consoles. |
Type Aliases
Type Alias | Description |
|---|---|
(BETA) | |
(BETA) | |
(BETA) | |
Represents the internal state of a TextRewriter subclass. |