ANSI codes overflow multi-line table cells
lionel-rowe opened this issue · comments
lionel-rowe commented
Due to TTY output not having any concept of soft line breaks, multi-line table cells with content wrapped in formatting ANSI codes cause their styles to overflow into adjacent borders and cells.
For example:
Table.from([[colors.yellow(`These ${colors.red("colors don’t")} run`), "Cell 2"]])
.border(true)
.columns([{ maxWidth: 12 }])
.render()
It would be helpful if this was handled automatically within the cell line wrapping logic.