Skip to content

Commit 1db9fe6

Browse files
committed
fix: make chcp non-blocking to avoid startup delays on Azure VMs
Use spawn() instead of output() for Windows UTF-8 console setup. On some Azure VMs, chcp can take 6+ seconds which causes health check failures.
1 parent f94395c commit 1db9fe6

File tree

1 file changed

+4
-2
lines changed
  • crates/terminator-mcp-agent/src

1 file changed

+4
-2
lines changed

crates/terminator-mcp-agent/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,17 @@ async fn main() -> Result<()> {
280280
}));
281281

282282
// Fix Windows encoding issues (IBM437 -> UTF-8)
283+
// NOTE: Using spawn() instead of output() to avoid blocking startup.
284+
// On some Azure VMs, chcp can take 6+ seconds which causes health check failures.
283285
#[cfg(target_os = "windows")]
284286
{
285287
use std::os::windows::process::CommandExt;
286288
const CREATE_NO_WINDOW: u32 = 0x08000000;
287289
let _ = std::process::Command::new("cmd")
288290
.args(["/c", "chcp", "65001"])
289291
.creation_flags(CREATE_NO_WINDOW)
290-
.output();
291-
eprintln!("Set Windows console to UTF-8 mode");
292+
.spawn(); // Non-blocking - don't wait for completion
293+
eprintln!("Set Windows console to UTF-8 mode (async)");
292294
}
293295

294296
// Initialize job object for automatic child process cleanup on exit

0 commit comments

Comments
 (0)