mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
Some setup flows end in a shell command instead of a natural-language install path, so Settings now exposes a host PTY terminal backed by portable-pty and xterm. The terminal inherits the user's login-shell environment, forces a UTF-8 locale when needed, and preserves split UTF-8 output so Chinese paths render correctly. Constraint: Desktop GUI apps do not inherit the user's interactive shell PATH on macOS. Constraint: Command output may split UTF-8 characters across PTY reads. Rejected: Use Tauri shell commands only | users need an interactive PTY for copy-pasted install flows. Rejected: Ask users to edit shell profiles | terminal setup should work out of the box. Confidence: high Scope-risk: moderate Directive: Keep terminal startup tied to host environment checks; do not bundle runtimes to solve PATH issues. Tested: cargo fmt --check; cargo test --lib; cargo check; cd desktop && bun run lint; cd desktop && bun run test src/pages/TerminalSettings.test.tsx; cd desktop && bun run build; cd desktop && bun run build:macos-arm64 Tested: Computer Use verified npm is available in the built macOS app terminal and Chinese output renders after UTF-8 decoding fix. Not-tested: Native Windows/Linux package runtime validation.