new_wrapped_table

Function new_wrapped_table 

Source
pub fn new_wrapped_table() -> Table
Expand description

Variant of new_table that opts into comfy-table’s terminal-width-aware [comfy_table::ContentArrangement::Dynamic] layout. Cells too wide for the available terminal width wrap inside the cell rather than pushing later columns past the edge, at the cost of taller rows. Used by ctprof compare / ctprof show under the --wrap flag; the existing fixed-column new_table stays the default for every other caller (locks, verifier, stats) so their output stays byte-stable for shell-pipeline consumers.

When stdout is not a TTY, comfy-table’s terminal-width probe returns None. The Dynamic arrangement is documented to degrade to Disabled in that case; we additionally call [comfy_table::Table::force_no_tty] under the same !stdout_color() gate as new_table, so a piped stdout that requested --wrap still suppresses ANSI escapes. The end-state behaviour under a non-TTY stdout is therefore equivalent to new_table’s — the wrap request is silently dropped rather than producing unbounded-wrap output without a width.