Skip to content

fix(tui): ignore empty slash commands - #33870

Closed
tangtaizong666 wants to merge 1 commit into
anomalyco:devfrom
tangtaizong666:fix/tui-bare-slash-submit
Closed

fix(tui): ignore empty slash commands#33870
tangtaizong666 wants to merge 1 commit into
anomalyco:devfrom
tangtaizong666:fix/tui-bare-slash-submit

Conversation

@tangtaizong666

Copy link
Copy Markdown

Issue for this PR

Closes #33867

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

A standalone / could be parsed as an empty slash command if the command list contained an empty command name. That lets the TUI send an empty session.command request instead of treating the input as non-command text.

This moves prompt slash command parsing into a small helper and requires a non-empty command name before matching registered commands. Existing slash command argument handling is preserved, including multiline arguments.

How did you verify your code works?

  • bun test test/component/prompt/submit-command.test.ts --timeout 10000
  • bun test test/cli/tui/prompt-submit-race.test.ts --timeout 10000
  • bun x prettier --check src/component/prompt/index.tsx src/component/prompt/submit-command.ts test/component/prompt/submit-command.test.ts
  • bun run typecheck

Screenshots / recordings

Not a UI layout change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI crashes when typing bare '/' and pressing Enter

1 participant