Slash command prompt not injected when pasting with arguments #7102

Open
opened 2026-02-16 18:06:11 -05:00 by yindo · 1 comment
Owner

Originally created by @brianjmeier on GitHub (Jan 21, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When pasting a slash command with arguments (e.g., /gcd:plan-phase 2), the prompt is not injected. The command only works if you type the command name, press Enter to select from autocomplete, then type the arguments in a separate message.

Steps to Reproduce

  1. Copy a slash command with arguments: /help topic or /some-command arg1 arg2
  2. Paste it into the prompt input
  3. The prompt is not injected - the input appears empty

Expected Behavior

The pasted command should be recognized and the prompt injected with the provided arguments.

Actual Behavior

The input is cleared and the command is not processed.

Root Cause

The hide() function in the autocomplete component clears text when closing. It checks if text starts with / and doesn't end with a space, but doesn't account for commands that already have arguments (contain whitespace).

Environment

  • macOS
  • OpenCode latest
Originally created by @brianjmeier on GitHub (Jan 21, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When pasting a slash command with arguments (e.g., `/gcd:plan-phase 2`), the prompt is not injected. The command only works if you type the command name, press Enter to select from autocomplete, then type the arguments in a separate message. ### Steps to Reproduce 1. Copy a slash command with arguments: `/help topic` or `/some-command arg1 arg2` 2. Paste it into the prompt input 3. The prompt is not injected - the input appears empty ### Expected Behavior The pasted command should be recognized and the prompt injected with the provided arguments. ### Actual Behavior The input is cleared and the command is not processed. ### Root Cause The `hide()` function in the autocomplete component clears text when closing. It checks if text starts with `/` and doesn't end with a space, but doesn't account for commands that already have arguments (contain whitespace). ### Environment - macOS - OpenCode latest
Author
Owner

@github-actions[bot] commented on GitHub (Jan 21, 2026):

This issue might be related to existing issues with slash command autocomplete and pasting. Please check:

  • #3910: Pasting file paths with line references causes error and disables Enter button
  • #3272: [FEATURE] Slash command accepts arguments
  • #8569: annoying bug when tag a file @ in CLI

The root cause you identified about the hide() function clearing text when it detects a command starting with / but containing whitespace is a useful observation for fixing the underlying issue.

@github-actions[bot] commented on GitHub (Jan 21, 2026): This issue might be related to existing issues with slash command autocomplete and pasting. Please check: - #3910: Pasting file paths with line references causes error and disables Enter button - #3272: [FEATURE] Slash command accepts arguments - #8569: annoying bug when tag a file @ in CLI The root cause you identified about the `hide()` function clearing text when it detects a command starting with `/` but containing whitespace is a useful observation for fixing the underlying issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7102