[−][src]Function mlc::control::set_virtual_terminal
pub fn set_virtual_terminal(use_virtual: bool) -> Result<(), ()>
Sets a flag to the console to use a virtual terminal environment.
This is primarily used for Windows 10 environments which will not correctly colorize the outputs based on ANSI escape codes.
The returned Result
is always Ok(())
, the return type was kept to ensure backwards
compatibility.
Notes
Only available to
Windows
build targets.
Example
use colored::*; control::set_virtual_terminal(false).unwrap(); println!("{}", "bright cyan".bright_cyan()); // will print '[96mbright cyan[0m' on windows 10 control::set_virtual_terminal(true).unwrap(); println!("{}", "bright cyan".bright_cyan()); // will print correctly