Skip to content

Quote tokens in delegating handlers to prevent parse errors#117

Merged
ldayton merged 2 commits into
mainfrom
fix/109-delegation-parse-error
Mar 22, 2026
Merged

Quote tokens in delegating handlers to prevent parse errors#117
ldayton merged 2 commits into
mainfrom
fix/109-delegation-parse-error

Conversation

@ldayton
Copy link
Copy Markdown
Owner

@ldayton ldayton commented Mar 22, 2026

Summary

  • Delegating handlers (uv, env, arch, caffeinate) used " ".join() to reconstruct inner commands for re-parsing, which strips shell quoting from tokens
  • Tokens containing metacharacters (parens, semicolons, etc.) caused parse error: Syntax error instead of delegating to the inner handler
  • Replaced with bash_join() which re-quotes tokens, matching the pattern xargs and fd already use

Example: uv run python -c "print('hello')" now correctly delegates to the python handler instead of failing with a parse error.

Closes #109
See #116 for discussion of a more general fix to the delegation round-trip.

ldayton added 2 commits March 22, 2026 20:53
Handlers that delegate (uv, env, arch, caffeinate) used " ".join()
to reconstruct inner commands, losing shell quoting. Tokens with
metacharacters (parens, semicolons) caused parse errors on re-parse.

Use bash_join() to re-quote tokens, matching the pattern xargs and
fd handlers already use.

Closes #109
@ldayton ldayton merged commit d9c9771 into main Mar 22, 2026
1 check passed
@ldayton ldayton deleted the fix/109-delegation-parse-error branch March 22, 2026 19:09
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.

uv run python -c "..." causes parse error: Syntax error

1 participant