Skip to content

Commit

Permalink
windows cli color fix (MystenLabs#2987)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkuo authored Jul 5, 2022
1 parent 344cb5c commit 224c374
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/sui/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn start_console(
writeln!(out)?;

let mut shell = Shell::new(
"sui>-$ ".bold().green(),
"sui>-$ ",
context,
ClientCommandHandler,
CommandStructure::from_clap(&install_shell_plugins(app)),
Expand Down
3 changes: 3 additions & 0 deletions crates/sui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ mod cli_tests;

#[tokio::main]
async fn main() {
#[cfg(windows)]
colored::control::set_virtual_terminal(true).unwrap();

let bin_name = env!("CARGO_BIN_NAME");
let cmd: SuiCommand = SuiCommand::parse();
let _guard = match cmd {
Expand Down
2 changes: 1 addition & 1 deletion crates/sui/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<P: Display, S: Send, H: AsyncHandler<S>> Shell<P, S, H> {
}));

loop {
write!(out, "{}", self.prompt)?;
write!(out, "{}", format!("{}", self.prompt).bold().green())?;
out.flush()?;

// Read a line
Expand Down

0 comments on commit 224c374

Please sign in to comment.