Repository navigation
fix(plugin): fall back to substitution-free launch when sandbox blocks osascript - #373
Merged
Merged
Conversation
…s osascript Claude Code's sandbox doesn't honor `excludedCommands` for commands containing a `$( )` substitution, so the documented `*/launch-revdiff.sh*` exclusion no longer matches the skill's one-call resolver+launcher invocation. Ghostty/iTerm2 launches fail inside the sandbox, even with the exclusion. This updates the skill to switch to a two-call form when a launch fails with an osascript error: run resolve-launcher.sh on its own, then run the printed launcher path literally, which the existing exclusion matches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Also: thank you for all your hard work on this project. I love revdiff - it has become a major part of my workflow ❤️ |
umputun
reviewed
Oct 8, 2026
umputun
left a comment
Owner
There was a problem hiding this comment.
the problem is real and the two-call form fixes the plain launch. A few wording changes before merge, all in .claude-plugin/skills/revdiff/SKILL.md:
:143,155- an osascript failure is treated as proof of a sandbox block, but the launcher exits 1 the same way on Ghostty older than 1.3.0, a denied Automation permission, or iTerm2 "session not found", and the user is then told to edit sandbox settings that can't help. Fix: say the sandbox may be the cause when it is enabled, retry once by literal path, and on a second failure report stderr and suggest the exclusion only when the sandbox is on. Pls name the key there assandbox.excludedCommands.:139- still says the resolver and launcher MUST run in the same bash invocation, four lines above the two-call instruction. Fix: state the fallback as the one exception.:143- "the sandbox blocks all commands with$( )substitutions" is wrong, they run and stay sandboxed. Fix: "a call containing a$( )substitution always stays sandboxed, so the exclusion can't apply to it".:64- the piped retry stays sandboxed too: every command in a call has to match the exclusion andgh pr diffdoesn't. Fix: drop this line.:150-153- the path in step 2 is unquoted, unlike lines 136 and 147, so a path with a space fails. Fix: quote it.
what Claude Code version are you on? Pls paste the output of the quoted literal-path launch passing with the exclusion configured, I have nothing newer than #102 showing that pattern matches.
umputun
added a commit
that referenced
this pull request
Oct 8, 2026
Since Claude Code 2.1.277 a sandbox exclusion applies only when every part of a command matches, so the "$(resolve-launcher.sh ...)" launch line and diffs piped into the launcher stay sandboxed, breaking Ghostty and iTerm2 even with the documented */launch-revdiff.sh* exclusion. Resolve the launcher separately and run its printed path as a plain command. The launcher-only --stdin-file option lets diff reviews use the same plain-command form.
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.
What is the problem?
Claude Code's sandbox no longer honors
excludedCommandsfor commands containing a$(...)substitution, so the documented*/launch-revdiff.sh*exclusion doesn't work anymore. Ghostty/iTerm2 launches fail inside the sandbox, even with the exclusion.How does this solve it?
This updates the skill to switch to a two-call form when a launch fails with an
osascripterror: runresolve-launcher.shon its own, then run the printed launcher path literally, which the existing exclusion matches.