Quote the interpreter path when launching background services - #364
Merged
Conversation
`_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
marked this pull request as ready for review
August 5, 2026 20:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Cause
terminal/__main__.py::_start_sessions()interpolatessys.executableunquoted into a shell command string (it pipes totee), then hands that string totmux 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 (theserviceandrunnersessions) share the samepythonvariable, so the one change covers both. A regression test patchessys.executableto a space-containing path and asserts bothnew-sessioncommands 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, anddashboard.pyall pass argv lists or alreadyshlex.quotetheir inputs. Details in theplan.mdartifact.🤖 Generated with Claude Code