baur icon indicating copy to clipboard operation
baur copied to clipboard

formatter: format output correctly when text contains ANSI escape codes

Open fho opened this issue 5 years ago • 0 comments

When the strings that are printed via the table.Formatter contain ANSI escape codes, like color sequences, the formatting is off. The escape codes are counted as characters but are not shown on the terminal. Replace the tabwriter with an implementation that ignores asci escape codes when calculating the column width.

This will allow to show color output in commands that currently aren't like baur status.

fho avatar Oct 06 '20 14:10 fho