[PR #9841] feat(commands): support escaping $ in custom command templates #13236

Open
opened 2026-02-16 18:18:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9841

State: open
Merged: No


What does this PR do?

Closes #9831

Add ability to escape dollar signs in custom command templates using backslash notation ($). This allows users to include literal $1, $ARGUMENTS, etc. in their templates without triggering substitution.

  • Add processEscapes() function in prompt.ts to handle -> conversion
  • Update hints() to ignore escaped placeholders when detecting arguments
  • Add unit tests for escape processing and hints detection
  • Document the escape syntax in commands.mdx

How did you verify your code works?

New unit tests. Manual tests using bun dev .

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9841 **State:** open **Merged:** No --- ### What does this PR do? Closes #9831 Add ability to escape dollar signs in custom command templates using backslash notation ($). This allows users to include literal $1, $ARGUMENTS, etc. in their templates without triggering substitution. - Add processEscapes() function in prompt.ts to handle $ -> $ conversion - Update hints() to ignore escaped placeholders when detecting arguments - Add unit tests for escape processing and hints detection - Document the escape syntax in commands.mdx ### How did you verify your code works? New unit tests. Manual tests using `bun dev .`
yindo added the pull-request label 2026-02-16 18:18:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13236