You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shell: quoted backticks rejected as command-substitution while $() passes #64066
The portable shell scanner hard-rejects any command containing backticks, even literal ones inside quoted strings, with Portable shell scanner cannot analyze command: command-substitution. Equivalent real $(...) command substitution executes fine. There is no override or escape hatch.
Send a shell command containing a literal backtick inside a double-quoted string, e.g. echoing a markdown code-fence sample: echo "fences look like ```ts ... ```".
For contrast, send a real command substitution: x=$(echo hi); echo "$x" — this executes normally.
Expected Behavior
Either execute the command in the real shell (it is valid shell syntax), or return an actionable error such as "backticks inside double quotes execute as command substitution — escape them", ideally with an escape/opt-out.
Actual Behavior
Hard reject with an internal-sounding message and no workaround; small rewordings hit the same wall. The command cannot be run at all.
Additional Context
POSIX-sh does treat quoted backticks as substitution, so the detection itself is not wrong — but the treatment is inconsistent with $(...) being allowed through, and the message gives the user no path forward. Workaround used: rewrite the command to avoid backticks entirely.
As I understand it, you'd like the shell tool to give a useful error, and ideally a way around it, when it refuses a command because of backticks. Today you only get Portable shell scanner cannot analyze command: command-substitution.
Refusing is intended. The permissions docs say that a command the scanner can't safely analyze "returns a scanner error rather than executing unverified subcommands". The scanner reads the text between backticks the same way it reads $(...). In the code I read, it only refuses when that inner text can't be analyzed or a backtick is never closed.
When I ran the scanner from the source on your example, echo "fences look like ```ts ... ```", it was accepted. Single-quoted backticks were accepted too. An unclosed backtick inside double quotes was refused. So the command that was actually refused probably differed from the example. If you still have it, please post the exact command.
What's left is the request for a clearer message and possibly an opt-out, and maintainers will consider it. Related:
fix(core): explain unanalyzable shell commands #54218: a pull request that replaced this error with an explanation and rewrite hints: single quotes, \``, or "$(cat file)"`. It kept the refusal, for permission safety. It was closed without being merged.
This was fixed in #65269, which makes commands the shell scanner can't analyze ask for permission instead of failing, so quoted backticks can run after approval. If you still see this on the latest version, comment here and we'll reopen.
Activity
opencodejr commentedon Nov 15, 2026
Thanks for the detailed report.
As I understand it, you'd like the shell tool to give a useful error, and ideally a way around it, when it refuses a command because of backticks. Today you only get
Portable shell scanner cannot analyze command: command-substitution.Refusing is intended. The permissions docs say that a command the scanner can't safely analyze "returns a scanner error rather than executing unverified subcommands". The scanner reads the text between backticks the same way it reads
$(...). In the code I read, it only refuses when that inner text can't be analyzed or a backtick is never closed.When I ran the scanner from the source on your example,
echo "fences look like ```ts ... ```", it was accepted. Single-quoted backticks were accepted too. An unclosed backtick inside double quotes was refused. So the command that was actually refused probably differed from the example. If you still have it, please post the exact command.What's left is the request for a clearer message and possibly an opt-out, and maintainers will consider it. Related:
\``, or"$(cat file)"`. It kept the refusal, for permission safety. It was closed without being merged.Until then, the workarounds are single quotes, escaping each backtick as
\``, or writing the text to a file and passing"$(cat file)"`.neriousy commentedon Nov 23, 2026
This was fixed in #65269, which makes commands the shell scanner can't analyze ask for permission instead of failing, so quoted backticks can run after approval. If you still see this on the latest version, comment here and we'll reopen.