fix(terminal): linux, macOS, win as the controlled (#13930)

1. `TERM` on linux terminal.
2. `htop` command not found on macOS.
3. `vim` and `claude code cli` hung up on windows.

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-01-07 16:07:14 +08:00
committed by GitHub
parent 5a183490dc
commit 8fe10d61ea
7 changed files with 1608 additions and 71 deletions

View File

@@ -615,6 +615,17 @@ pub fn core_main() -> Option<Vec<String>> {
#[cfg(feature = "hwcodec")]
crate::ipc::hwcodec_process();
return None;
} else if args[0] == "--terminal-helper" {
// Terminal helper process - runs as user to create ConPTY
// This is needed because ConPTY has compatibility issues with CreateProcessAsUserW
#[cfg(target_os = "windows")]
{
let helper_args: Vec<String> = args[1..].to_vec();
if let Err(e) = crate::server::terminal_helper::run_terminal_helper(&helper_args) {
log::error!("Terminal helper failed: {}", e);
}
}
return None;
} else if args[0] == "--cm" {
// call connection manager to establish connections
// meanwhile, return true to call flutter window to show control panel