Skip to content

Conversation

@continue
Copy link
Contributor

@continue continue bot commented Nov 19, 2025

Problem

When using slash commands in the Continue CLI (tested on Windows 11 with PowerShell in VS Code), users had to press Enter twice for the command to execute:

  1. First Enter press: Selects the command and inserts it into the input field (e.g., /exit )
  2. Second Enter press: Actually submits the command

This was frustrating UX and is reported in issue #8683.

Solution

Modified the handleSlashCommandNavigation function in UserInput.tsx to detect when:

  1. The user presses Enter (not Tab)
  2. The current input is an exact match for a slash command (case-insensitive)

When both conditions are met, the function returns false instead of handling the selection, which allows the handleEnterKey function to process the submission immediately.

Behavior Preserved

  • Tab key: Still autocompletes the command without submitting (requires Enter to submit)
  • Partial matches: Still autocompletes to the full command name and requires a second Enter
  • Non-exact matches: Existing behavior maintained

Test Cases Covered

✅ Exact match with Enter (e.g., typing /exit and pressing Enter) - submits immediately
✅ Partial match with Enter (e.g., typing /exi and pressing Enter) - autocompletes to /exit
✅ Tab autocomplete - autocompletes without submitting
✅ Case insensitive matching (e.g., /EXIT works the same as /exit)

Fixes #8683


This agent session was co-authored by dallin and Continue.


Summary by cubic

Slash commands in the CLI now submit on a single Enter when the input exactly matches a command that doesn't require arguments, removing the double-Enter requirement. Fixes #8683.

  • Bug Fixes
    • Detect exact match (case-insensitive) and submit on Enter.
    • Skip auto-submit for commands that need args (/title, /init).
    • Tab still autocompletes without submitting.
    • Partial/non-exact matches still autocomplete and require Enter.

Written for commit 665dba9. Summary will update automatically on new commits.

When using slash commands in the CLI, users previously had to press
Enter twice - once to select the command and once to submit it.

This fix checks if the user typed an exact match for a command and
pressed Enter. If so, the command is submitted immediately instead of
just being selected.

The fix maintains the existing behavior for:
- Tab key (autocomplete only, no submission)
- Partial matches (autocomplete to full command name)

Fixes #8683

Co-authored-by: dallin <[email protected]>
@continue continue bot requested a review from a team as a code owner November 19, 2025 04:00
@continue continue bot requested review from Patrick-Erichsen and removed request for a team November 19, 2025 04:00
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 19, 2025
@github-actions
Copy link

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@continue continue bot added area:slash-commands Relates to the slash commands feature kind:bug Indicates an unexpected problem or unintended behavior labels Nov 19, 2025
Commands like /title and /init require arguments, so they should not
auto-submit when user presses Enter on an exact match. Instead, they
should autocomplete and wait for the user to add arguments.

This ensures users don't accidentally submit incomplete commands.

Co-authored-by: dallin <[email protected]>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@continue
Copy link
Contributor Author

continue bot commented Nov 19, 2025

Added a follow-up commit to handle commands that require arguments.

Commands like /title and /init now correctly autocomplete but don't auto-submit, since they need additional input from the user. This prevents accidentally submitting incomplete commands.

Updated behavior:

  • /exit, /help, /clear, etc. → Auto-submit on Enter ✅
  • /title, /init → Autocomplete to /title and wait for arguments ✅

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

Labels

area:slash-commands Relates to the slash commands feature kind:bug Indicates an unexpected problem or unintended behavior size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Slash commands require double Enter

1 participant