diff --git a/termcolor/src/lib.rs b/termcolor/src/lib.rs index bcb534a18..94cc0bfeb 100644 --- a/termcolor/src/lib.rs +++ b/termcolor/src/lib.rs @@ -973,7 +973,7 @@ impl WriteColor for Ansi { } fn reset(&mut self) -> io::Result<()> { - self.write_str("\x1B[m") + self.write_str("\x1B[0m") } } diff --git a/tests/tests.rs b/tests/tests.rs index 4bd852cdb..9e93455f0 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -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); });