1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-04-24 17:12:16 +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<()> { 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!( let expected = format!(
"{colored_path}:foo\n{colored_path}-bar\n", "{colored_path}:foo\n{colored_path}-bar\n",
colored_path=format!( 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"))); path=path("sherlock")));
assert_eq!(lines, expected); 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: // Technically, the expected output should only be two lines, but:
// https://github.com/BurntSushi/ripgrep/issues/441 // https://github.com/BurntSushi/ripgrep/issues/441
let expected = "\ let expected = "\
1: 1:
2: 2:
4: 4:
"; ";
assert_eq!(expected, lines); assert_eq!(expected, lines);
}); });