mirror of
https://github.com/Lakr233/vphone-cli.git
synced 2026-09-02 02:34:29 +00:00
Foundation `Process` starts children in a NEW process group, so a sudo it spawns is a *background* member of the controlling terminal — it can't disable echo or read the tty, so the typed password showed and wasn't delivered. No stdio wiring fixes that (confirmed: a Process child's pgid != the parent's). Add VPhoneProcessRunner.runForeground: hand the terminal to the child's process group via tcsetpgrp (SIGTTOU/SIGTTIN ignored during the swap), restore ours after. The CFW-install step uses it when no --sudo-password is given, so sudo owns the tty and reads the password DIRECTLY — vphone-cli never sees it. Its `echo` flag still honors verbosity: quiet suppresses the install's own output (stdout/stderr → /dev/null) while sudo's /dev/tty prompt keeps working. With --sudo-password the unattended askpass path is unchanged; a non-interactive run with no password fails fast. Verified under a PTY: without tcsetpgrp the child is background (the bug); with it the child is foreground; and echo=false hides the child's output while it stays foreground. Also serialize LibraryTests: its two VPHONE_LIBRARY_ROOT env tests mutate a process-global and raced under Swift Testing's parallelism (intermittent failures) — mark the suite @Suite(.serialized). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Y4VDqWf5pVakcFLqB23CKe