Skip to main content

Module terminal

Module terminal 

Source
Expand description

§Terminal Display Helpers

Styled output utilities for rich, user-friendly terminal presentation. Text is painted by semantic role through super::theme, with unicode box-drawing characters for structure. All helpers respect non-TTY contexts (piped output) by falling back to plain text. Long text is automatically word-wrapped to the detected terminal width.

Re-exports§

pub use super::theme::color_enabled;
pub use super::theme::color_enabled_stderr;
pub use super::theme::color_enabled_with;
pub use super::theme::set_color_override;

Structs§

Col
Column specification for table formatting.

Functions§

blank_row
Empty line with continuation bar.
bullet_row
A bullet-point row inside a section.
chart_row
A line of a chart inside a section, after the bar: the line is drawn and painted already, so it is neither wrapped nor painted again.
check_fail
Health check fail line.
check_na
Formats a check that does not apply (dim dash, message in grey).
check_pass
Health check pass line.
check_warn
A check row for a warning: outside its target, but not a failure.
detail_row
An indented detail line inside a section (for sub-items like vulnerability descriptions).
format_price_peg
Format a price with color for peg deviation. The bands come from the health thresholds: green on the peg, yellow inside the outlier band, red outside it.
info_row
An informational note row inside a section box.
kv_row
A key-value row inside a section, with aligned values.
kv_row_delta
A key-value row where the value is colored based on positive/negative.
labelled_warn
A warning with a name in a column of label_cols and its detail after it, wrapped under the detail: one signal of a list.
link_row
A link row inside a section box.
numbered_row
Format an enumerated list item inside a section box.
orderbook_level
An order book level row with price coloring relative to peg.
painter
The painter the row helpers use: color when stdout takes it.
score_bar
A visual score bar with color coding.
section_footer
Section footer (closing box line).
section_header
Section header with colored title and box-drawing underline.
separator
A separator row inside a section.
set_width_override
Sets the width that terminal_width returns for the whole process, or removes the override (None). Some(0) also removes it. The TUI removes it each time it gives the terminal back.
severity_label
Severity label with color coding.
status_line
Overall status line (healthy / unhealthy).
subsection_header
Sub-section header (lighter weight).
table_header
Format a table header row inside a section box.
table_row
Format a table data row inside a section box.
terminal_width
Returns the current terminal width in columns.
warning_row
A warning banner inside a section box.
width_override
The width override, if one is set.
wrap_lines
Word-wrap text so each line fits within content_width columns.