[PR #9883] fix(tui): preserve pasted slash commands with arguments #13256

Open
opened 2026-02-16 18:18:07 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9883

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9883 **State:** open **Merged:** No --- 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
yindo added the pull-request label 2026-02-16 18:18:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13256