Skip to main content

Module format

Module format 

Source
Expand description

Shared formatting utilities used across commands and output

Provides common string formatting, truncation, and colorization.

Structs§

ProcessTableBudget
What the three flexible process-table columns may use at a given terminal width, once the fixed columns are accounted for.

Functions§

colorize_status
Colorize a process status string based on the status variant.
format_duration
Format a duration in seconds to a human-readable string.
format_memory
Format memory in MB to a human-readable string with adaptive units.
plural
Return “es” for plural process counts, “” for singular.
process_table_budget
Column budget for a process table rendered at width terminal columns.
truncate_path
Truncate a path to max_width terminal columns, eliding the middle.
truncate_string
Truncate s to max_width terminal columns, appending … when cut.
uptime_label
Uptime as a trailing label for one-line process views (tree, why): " up 3m 12s", or empty when unknown.