Skip to content

[Feature]: Support slash commands mid-prompt, not only at the start #16262

Closed as not planned

Description

@luisfelipesena

Verify there is no existing issue for this

  • I searched existing issues and this is not a duplicate

Description

Currently, slash commands (/undo, /new, /compact, custom commands) only trigger when typed at the very beginning of an empty prompt. The regex rawText.match(/^\/(\S*)$/) requires the entire input to be just the slash command.

This means users cannot type context first and then invoke a slash command, e.g.:

  • explain the auth flow /compact — does nothing
  • fix the bug in auth.ts /undo — does nothing

Expected: Typing / after a space anywhere in the prompt should open the slash command popover, just like @ mentions work mid-prompt today.

After selecting:

  • Custom commands: replace the /trigger fragment with the expanded command, keep surrounding text
  • Builtin commands: remove the /trigger fragment, keep surrounding text, execute the command

Related: the @ mention popover already works mid-prompt via textBeforeCursor.match(/@(\S*)$/). Slash commands should behave the same way.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 6, 2026
  2. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. devdeyaa commented on May 18, 2026

    @devdeyaa

    I am experiencing this on v1.15.4 in both Desktop and TUI. I have performed a clean reset of my cache and the issue persists. The slash menu only triggers at the very start of the prompt. This seems to be a regression or a feature that was not fully implemented/deployed in the latest release.

  4. github-actions commented on Jul 17, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions