1
0
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:
kennytm 2018-01-30 03:14:55 +08:00 committed by Andrew Gallant
parent ed9150c9b4
commit 8514d4fbb4
2 changed files with 5 additions and 5 deletions

View File

@ -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")
}
}

View File

@ -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 = "\
1:
2:
4:
1:
2:
4:
";
assert_eq!(expected, lines);
});