mirror of
https://github.com/sharkdp/bat.git
synced 2026-02-08 00:32:08 +00:00
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
112 KiB
112 KiB