Skip to content

fix(tui): preserve pasted slash commands with arguments#9883

Closed
brianjmeier wants to merge 1 commit into
anomalyco:devfrom
brianjmeier:fix/slash-command-paste-parsing
Closed

fix(tui): preserve pasted slash commands with arguments#9883
brianjmeier wants to merge 1 commit into
anomalyco:devfrom
brianjmeier:fix/slash-command-paste-parsing

Conversation

@brianjmeier

Copy link
Copy Markdown

Fixes #9880

Problem

Pasting a slash command with arguments (e.g., /gcd:plan-phase 2) clears the input instead of injecting the prompt.

Cause

The hide() function in autocomplete clears text when it starts with / and doesn't end with space, but doesn't check if arguments are already present.

Fix

Check for any whitespace in the text. If present, preserve it (command has arguments).

Verification

  • Added 17 unit tests covering partial commands, commands with args, pasted commands, edge cases
  • bun test test/cli/tui/autocomplete.test.ts passes

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

When pasting a slash command with arguments (e.g., '/gcd:plan-phase 2'),
the text would get deleted because the hide() function was too aggressive
about cleaning up abandoned partial commands.

The fix checks for whitespace in the text - if present, it means the
command has arguments and should be preserved.

- Extract shouldClearSlashCommand() into testable utility
- Add comprehensive tests for slash command clearing logic
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash command prompt not injected when pasting with arguments

1 participant