mirror of
https://github.com/sharkdp/bat.git
synced 2026-11-28 13:36:07 +00:00
`--decorations=auto` is documented to enable decorations only when stdout is an interactive terminal, but `--color=always` forces the printer path and the requested style components were applied anyway. `bat --color=always file | cat` therefore printed the header, grid, and line numbers. Return an empty component set when stdout is not interactive unless decorations are explicitly `always` or `--force-colorization` is used. Explicit `-n` and `-b` flags are still honored, matching the existing `cat -n` compatibility behavior, and `--diff` keeps its change markers. Adds integration tests for piped color output with auto decorations, with `--style=full`, and with `--decorations=always`. Fixes #3710