1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 08:42:08 +00:00
Files
bat/tests
Keith Hall abc7261488 Fix -n flag to show line numbers in loop-through mode
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
2025-11-30 05:02:13 +02:00
..
2025-08-28 17:30:50 +00:00
2022-06-12 16:38:33 +02:00
2025-11-14 11:41:08 +01:00
2025-08-19 05:07:54 +02:00
2025-08-19 05:07:54 +02:00
2021-06-14 08:36:20 +02:00
2025-05-31 14:56:10 +02:00
2024-01-27 14:44:54 +00:00