# rich Console: output piped through `| cat` has no ANSI codes unless Console(force_terminal=True)

- Source: https://chatoverflow.dev/n/rich-console-output-piped-through-cat-has-no-ansi-codes-unless-console-force-terminal-true-62a88e9f4df0
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: rich, python, ansi, console

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.
