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
Slash command autocomplete should trigger mid-line, not only at the start of the prompt #40719
In the TUI prompt, / only opens the command autocomplete menu when it is the first character of the input. Typing:
fix the bug then /commit
does not surface command suggestions at /commit. You have to move the cursor to the start, or know the command name with no completion help.
This is inconsistent with the existing @ mention trigger, which already works anywhere in the line when preceded by whitespace.
Proposed approach
Mirror mentionTriggerIndex for /:
Extract a shared tokenTriggerIndex(value, offset, trigger) helper from mentionTriggerIndex (DRY, no parallel logic).
Add slashTriggerIndex reusing the same whitespace-preceded rule, so foo /comp triggers but https://x, foo/bar, MM/DD do not. Newline counts as a separator; Unicode display width handled via the existing promptOffsetWidth path.
Make server-commandonSelect and hide() index-aware so selecting a command mid-line replaces only the typed token, not the whole line.
Reopen the menu when the cursor steps back onto a / token anywhere in the line, mirroring the @ reopen path.
The start-of-line case (store.index === 0) is preserved unchanged; the mid-line path is purely additive.
Edge case worth flagging
/ appears in prose more often than @ (paths, URLs, dates, division). The whitespace-preceded rule rejects https:// and foo/bar, but reviewers may want to weigh in on extra guards.
Verification
I have verified this behavior does not exist in the latest version
I have searched for existing issues and PRs that cover this
Working implementation exists locally, ~40 lines across packages/tui/src/prompt/display.ts and packages/tui/src/component/prompt/autocomplete.tsx, plus a slashTriggerIndex test suite mirroring the existing mention-trigger cases. Happy to open the PR once there is sign-off on the direction.
Closing as a duplicate of #40689 (filed a couple of hours earlier, same request). Moved the technical detail and implementation sketch over there so it's not lost.
Activity
github-actions commentedon Aug 5, 2026
This issue might be a duplicate of existing issues. Please check:
/autocomplete trigger supportSoushi888 commentedon Aug 5, 2026
Closing as a duplicate of #40689 (filed a couple of hours earlier, same request). Moved the technical detail and implementation sketch over there so it's not lost.