From aa1723f45dc4140d9abe1e99952ff42b16a7c715 Mon Sep 17 00:00:00 2001 From: kennytm Date: Fri, 12 Jan 2018 04:16:23 +0800 Subject: [PATCH 1/2] Write `Ansi::reset()` using `\x1b[0m` instead of `\x1b[m` Workaround appveyor/ci#1824. --- termcolor/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") } } From 89329ee02571840019a12c76a2cd4c0806e12ba5 Mon Sep 17 00:00:00 2001 From: kennytm Date: Fri, 12 Jan 2018 04:41:12 +0800 Subject: [PATCH 2/2] Fix tests. --- tests/tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); });