Skip to content

Quote the interpreter path when launching background services - #364

Merged
tildesrc merged 1 commit into
mainfrom
panopticon/quote-pipx-python-path
Aug 5, 2026
Merged

Quote the interpreter path when launching background services#364
tildesrc merged 1 commit into
mainfrom
panopticon/quote-pipx-python-path

Conversation

@tildesrc

@tildesrc tildesrc commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Problem

macOS users who install panopticon via pipx get an interpreter path under ~/Library/Application Support/pipx/... — which contains a space. Starting the background services fails:

zsh: no such file or directory: /Users/salmanansari/Library/Application

Cause

terminal/__main__.py::_start_sessions() interpolates sys.executable unquoted into a shell command string (it pipes to tee), then hands that string to tmux new-session, which runs it via /bin/sh -c. The space in the path word-splits and the shell tries to exec the truncated first word.

Fix

Wrap the interpreter path in shlex.quote(sys.executable). Both loop entries (the service and runner sessions) share the same python variable, so the one change covers both. A regression test patches sys.executable to a space-containing path and asserts both new-session commands carry the quoted path (parsing back to a single argv token).

An audit of every other shell-execution / interpolation site in src/ found no further instances — console.py, local_runner.py, shell_runner.py, and dashboard.py all pass argv lists or already shlex.quote their inputs. Details in the plan.md artifact.

🤖 Generated with Claude Code

`_start_sessions()` interpolates `sys.executable` into a shell command string
(it pipes to `tee`) that tmux runs via `/bin/sh -c`. A pipx install on macOS
lives under `~/Library/Application Support/...`, so the space word-split the
path and startup failed with:

    zsh: no such file or directory: /Users/.../Library/Application

Wrap it in `shlex.quote`. Regression test covers both the service and runner
sessions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tildesrc
tildesrc marked this pull request as ready for review August 5, 2026 20:23
@tildesrc
tildesrc merged commit ae46a87 into main Aug 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant