mirror of
https://github.com/sharkdp/bat
synced 2026-07-20 16:33:20 +00:00
abc7261488
When the -n/--number flag is passed on the command line, bat now shows line numbers even when piping output to another process (loop-through mode), similar to how `cat -n` behaves. This change detects if -n or --number was passed on the CLI (before merging with config file and environment variables) and disables loop-through mode in that case, allowing the InteractivePrinter to add line numbers. The existing behavior is preserved: - Styles from config/env are still ignored when piping (unless --decorations=always is set) - Only the -n flag from CLI enables line numbers in piped mode - -p and --style options from CLI do not disable loop-through mode