euporie.core.kernel.local.Terminal256Formatter

class euporie.core.kernel.local.Terminal256Formatter(**options)

Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in TerminalFormatter color sequences are terminated at newlines, so that paging the output works correctly.

The formatter takes colors from a style defined by the style option and converts them to nearest ANSI 256-color escape sequences. Bold and underline attributes from the style are preserved (and displayed).

Added in version 0.9.

Changed in version 2.2: If the used style defines foreground colors in the form #ansi*, then Terminal256Formatter will map these to non extended foreground color. See AnsiTerminalStyle for more information.

Changed in version 2.4: The ANSI color names have been updated with names that are easier to understand and align with colornames of other projects and terminals. See this table for more information.

Options accepted:

style

The style to use, can be a string or a Style subclass (default: 'default').

linenos

Set to True to have line numbers on the terminal output as well (default: False = no line numbers).