Skip to content

Commit

Permalink
Merge pull request #227 from gwenn/windows_colors
Browse files Browse the repository at this point in the history
Fix colors on Windows
  • Loading branch information
gwenn authored May 19, 2019
2 parents ca87239 + 7c67981 commit 6b1b946
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tty/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ impl Term for Console {
let raw = original_stdstream_mode | wincon::ENABLE_VIRTUAL_TERMINAL_PROCESSING;
self.ansi_colors_supported =
unsafe { consoleapi::SetConsoleMode(self.stdstream_handle, raw) != 0 };
debug!(target: "rustyline", "ansi_colors_supported: {}", self.ansi_colors_supported);
} else {
debug!(target: "rustyline", "ANSI colors already enabled");
self.ansi_colors_supported = true;
}
Some(original_stdstream_mode)
} else {
Expand Down

0 comments on commit 6b1b946

Please sign in to comment.