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:
@@ -9,6 +9,7 @@
|
|||||||
- Fix hang when using `--list-themes` with an explicit pager, see #3457 (@abhinavcool42)
|
- Fix hang when using `--list-themes` with an explicit pager, see #3457 (@abhinavcool42)
|
||||||
- Fix negative values of N not being parsed in <N:M> line ranges without `=` flag value separator, see #3442 (@lmmx)
|
- Fix negative values of N not being parsed in <N:M> line ranges without `=` flag value separator, see #3442 (@lmmx)
|
||||||
- Fix broken Docker syntax preventing use of custom assets, see #3476 (@keith-hall)
|
- Fix broken Docker syntax preventing use of custom assets, see #3476 (@keith-hall)
|
||||||
|
- Fix decorations being applied unexpectedly when piping, breaking cat compatibility. See #3496 (@keith-hall)
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
- Improve README documentation on pager options passed to less, see #3443 (@injust)
|
- Improve README documentation on pager options passed to less, see #3443 (@injust)
|
||||||
|
|||||||
@@ -384,8 +384,7 @@ impl App {
|
|||||||
.map(|s| s.as_str())
|
.map(|s| s.as_str())
|
||||||
== Some("always")
|
== Some("always")
|
||||||
|| self.matches.get_flag("force-colorization")
|
|| self.matches.get_flag("force-colorization")
|
||||||
|| self.matches.get_flag("number")
|
|| self.matches.get_flag("number")),
|
||||||
|| self.matches.contains_id("style") && !style_components.plain()),
|
|
||||||
tab_width: self
|
tab_width: self
|
||||||
.matches
|
.matches
|
||||||
.get_one::<String>("tabs")
|
.get_one::<String>("tabs")
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ fn piped_output_with_line_numbers_style_flag() {
|
|||||||
.write_stdin("hello\nworld\n")
|
.write_stdin("hello\nworld\n")
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout(" 1 hello\n 2 world\n");
|
.stdout("hello\nworld\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -426,15 +426,7 @@ fn piped_output_with_line_numbers_with_header_grid_style_flag() {
|
|||||||
.write_stdin("hello\nworld\n")
|
.write_stdin("hello\nworld\n")
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout(
|
.stdout("hello\nworld\n");
|
||||||
"─────┬──────────────────────────────────────────────────────────────────────────
|
|
||||||
│ STDIN
|
|
||||||
─────┼──────────────────────────────────────────────────────────────────────────
|
|
||||||
1 │ hello
|
|
||||||
2 │ world
|
|
||||||
─────┴──────────────────────────────────────────────────────────────────────────
|
|
||||||
",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -452,6 +444,7 @@ fn piped_output_with_auto_style() {
|
|||||||
fn piped_output_with_default_style_flag() {
|
fn piped_output_with_default_style_flag() {
|
||||||
bat()
|
bat()
|
||||||
.arg("--style=default")
|
.arg("--style=default")
|
||||||
|
.arg("--decorations=always")
|
||||||
.write_stdin("hello\nworld\n")
|
.write_stdin("hello\nworld\n")
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
|
|||||||
Reference in New Issue
Block a user