From 64effb6033d8bbe4ca88a0b5f84de85b956332f0 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 7 Jun 2026 23:13:49 -0700 Subject: [PATCH] =?UTF-8?q?feat(process):=20=E2=9C=A8=20update=20zsh=20she?= =?UTF-8?q?ll=20to=20interactive=20mode=20for=20full=20PATH=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- Sources/PlumTVCore/ProcessRunner.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/PlumTVCore/ProcessRunner.swift b/Sources/PlumTVCore/ProcessRunner.swift index 0c42522..9d115e7 100644 --- a/Sources/PlumTVCore/ProcessRunner.swift +++ b/Sources/PlumTVCore/ProcessRunner.swift @@ -31,14 +31,16 @@ public enum ProcessRunner { stderr: String(decoding: e, as: UTF8.self)) } - /// Run a command string under a login shell (`/bin/zsh -lc`) so the user's - /// PATH (bun, uv, …) is available even from a GUI app's minimal environment. + /// Run a command string under an interactive login shell (`/bin/zsh -ilc`) so + /// the user's full PATH (bun in ~/.bun/bin, uv, …) is available even from a GUI + /// app's minimal environment. `-i` is required because bun's PATH is exported + /// from ~/.zshrc, which a non-interactive login shell does NOT source. /// Output is drained on background queues to avoid pipe-buffer deadlock, and /// the process is terminated if it exceeds `timeout`. public static func runShell(_ command: String, timeout: TimeInterval, cwd: String? = nil) -> ProcessResult { let p = Process() p.executableURL = URL(fileURLWithPath: "/bin/zsh") - p.arguments = ["-lc", command] + p.arguments = ["-ilc", command] if let cwd { p.currentDirectoryURL = URL(fileURLWithPath: cwd) } let out = Pipe() let err = Pipe()