Skip to content

Commit 53fe783

Browse files
fix: add enable-ansi-support for windows compatibility (#2700)
Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
1 parent f1c938a commit 53fe783

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎Cargo.lock‎

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ clap_complete = "4.6.0"
3434
colored = "3.1.1"
3535
console = "0.16.3"
3636
convert_case = "0.11.0"
37-
3837
derive_more = { version = "2.1.1", features = ["from", "display", "debug", "deref", "as_ref", "try_into"] }
38+
enable-ansi-support = "0.3.1"
3939
derive_setters = "0.1.9"
4040
dirs = "6.0.0"
4141
dissimilar = "1.0.9"

‎crates/forge_main/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ strip-ansi-escapes.workspace = true
6565
terminal_size = "0.4"
6666
rustls.workspace = true
6767

68+
[target.'cfg(windows)'.dependencies]
69+
enable-ansi-support.workspace = true
70+
6871
[target.'cfg(not(target_os = "android"))'.dependencies]
6972
arboard = "3.4"
7073

‎crates/forge_main/src/main.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ use forge_main::{Cli, Sandbox, TitleDisplayExt, UI, tracker};
1010

1111
#[tokio::main]
1212
async fn main() -> Result<()> {
13+
// Enable ANSI color support on Windows console
14+
#[cfg(windows)]
15+
let _ = enable_ansi_support::enable_ansi_support();
16+
1317
// Install default rustls crypto provider (ring) before any TLS connections
1418
// This is required for rustls 0.23+ when multiple crypto providers are
1519
// available

0 commit comments

Comments
 (0)