1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 00:32:08 +00:00

Fix to not show style decorations in auto mode when piping

This commit is contained in:
Keith Hall
2025-11-29 17:32:49 +02:00
parent d17481575a
commit 7d37325c19
3 changed files with 5 additions and 12 deletions

View File

@@ -415,7 +415,7 @@ fn piped_output_with_line_numbers_style_flag() {
.write_stdin("hello\nworld\n")
.assert()
.success()
.stdout(" 1 hello\n 2 world\n");
.stdout("hello\nworld\n");
}
#[test]
@@ -426,15 +426,7 @@ fn piped_output_with_line_numbers_with_header_grid_style_flag() {
.write_stdin("hello\nworld\n")
.assert()
.success()
.stdout(
"─────┬──────────────────────────────────────────────────────────────────────────
│ STDIN
─────┼──────────────────────────────────────────────────────────────────────────
1 │ hello
2 │ world
─────┴──────────────────────────────────────────────────────────────────────────
",
);
.stdout("hello\nworld\n");
}
#[test]
@@ -452,6 +444,7 @@ fn piped_output_with_auto_style() {
fn piped_output_with_default_style_flag() {
bat()
.arg("--style=default")
.arg("--decorations=always")
.write_stdin("hello\nworld\n")
.assert()
.success()