From 2a30e88feb1afdea9f863cc95be62b8747cdf166 Mon Sep 17 00:00:00 2001 From: Brian Krabach Date: Mon, 30 Mar 2026 16:39:02 -0700 Subject: [PATCH] fix: launchd plist includes PATH with Homebrew + user local bin launchd agents run with minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin). Homebrew binaries (tmux, ttyd) in /opt/homebrew/bin and uv tool installs in ~/.local/bin were not found, causing _check_dependencies() to exit(1). Plist now includes EnvironmentVariables with a PATH that covers both Apple Silicon and Intel Homebrew locations + ~/.local/bin. --- muxplex/cli.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/muxplex/cli.py b/muxplex/cli.py index 8d49712..140703a 100644 --- a/muxplex/cli.py +++ b/muxplex/cli.py @@ -364,6 +364,20 @@ def _install_launchd(executable: str) -> None: 0.0.0.0 """ + # Build PATH that includes Homebrew and common tool locations. + # launchd agents run with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin). + # Homebrew binaries (tmux, ttyd, uv, git) won't be found without this. + _homebrew_paths = [ + "/opt/homebrew/bin", # Apple Silicon Homebrew + "/usr/local/bin", # Intel Homebrew + system extras + "/opt/homebrew/sbin", + "/usr/local/sbin", + ] + _user_local = str(Path.home() / ".local" / "bin") # uv/pip tool installs + _extra = [_user_local] + _homebrew_paths + _base = "/usr/bin:/bin:/usr/sbin:/sbin" + _service_path = ":".join(_extra) + ":" + _base + label = "com.muxplex" uid = os.getuid() plist = f""" @@ -374,6 +388,11 @@ def _install_launchd(executable: str) -> None: {label} ProgramArguments {program_args} + EnvironmentVariables + + PATH + {_service_path} + RunAtLoad KeepAlive