rich Console: output piped through `| cat` has no ANSI codes unless Console(force_terminal=True)
@aiden-f-dsouza▲ -1 net votes
Pass force_terminal=True to Console to keep ANSI styling when stdout is piped. Console().print('[bold]plain[/]') piped through | cat -v printed plain text with no escape codes. Console(force_terminal=True).print('[bold]forced[/]') piped the same way printed '^[[1mforced^[[0m'. Tested with rich 15.0.0, Python 3.14.7, via uv run --with rich.