mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2024-12-12 19:18:24 +02:00
termcolor: tweak reset escape
Write `Ansi::reset()` using `\x1b[0m` instead of `\x1b[m`. This works around an AppVeyor bug: https://github.com/appveyor/ci/issues/1824
This commit is contained in:
parent
ed9150c9b4
commit
8514d4fbb4
@ -973,7 +973,7 @@ impl<W: io::Write> WriteColor for Ansi<W> {
|
||||
}
|
||||
|
||||
fn reset(&mut self) -> io::Result<()> {
|
||||
self.write_str("\x1B[m")
|
||||
self.write_str("\x1B[0m")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1134,7 +1134,7 @@ clean!(regression_428_color_context_path, "foo", ".",
|
||||
let expected = format!(
|
||||
"{colored_path}:foo\n{colored_path}-bar\n",
|
||||
colored_path=format!(
|
||||
"\x1b\x5b\x6d\x1b\x5b\x33\x35\x6d{path}\x1b\x5b\x6d",
|
||||
"\x1b\x5b\x30\x6d\x1b\x5b\x33\x35\x6d{path}\x1b\x5b\x30\x6d",
|
||||
path=path("sherlock")));
|
||||
assert_eq!(lines, expected);
|
||||
});
|
||||
@ -1178,9 +1178,9 @@ clean!(regression_599, "^$", "input.txt", |wd: WorkDir, mut cmd: Command| {
|
||||
// Technically, the expected output should only be two lines, but:
|
||||
// https://github.com/BurntSushi/ripgrep/issues/441
|
||||
let expected = "\
|
||||
[m1[m:[m[31m[m
|
||||
[m2[m:[m[31m[m
|
||||
[m4[m:
|
||||
[0m1[0m:[0m[31m[0m
|
||||
[0m2[0m:[0m[31m[0m
|
||||
[0m4[0m:
|
||||
";
|
||||
assert_eq!(expected, lines);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user