From dd55995768c2e6f3e94975e88cf81153eb6526cf Mon Sep 17 00:00:00 2001 From: konsti Date: Mon, 15 Apr 2024 18:12:54 +0200 Subject: [PATCH] Force color for build error messages (#3032) Since we're using anstream's strip stream, we can force color output from child processes and strip them when we redirect to a file Before: ![image](https://github.com/astral-sh/uv/assets/6826232/ce8aafe9-687c-4c4a-970a-22abd660bc71) After: ![image](https://github.com/astral-sh/uv/assets/6826232/bacedf1c-2462-4947-bd2f-393476a8031b) Redirecting to a file correctly strips color codes. --- crates/uv-build/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/uv-build/src/lib.rs b/crates/uv-build/src/lib.rs index 7d8ff3795..4cf7bc04b 100644 --- a/crates/uv-build/src/lib.rs +++ b/crates/uv-build/src/lib.rs @@ -999,6 +999,7 @@ async fn run_python_script( .env("PATH", modified_path) // Activate the venv .env("VIRTUAL_ENV", venv.root()) + .env("CLICOLOR_FORCE", "1") .output() .await .map_err(|err| Error::CommandFailed(venv.python_executable().to_path_buf(), err))