Skip to content

Selecting a skill via prompt_skills keybind or Ctrl+P clears the input draft #39376

Description

@AzYuJie

Description

When the input box already contains text (a draft prompt), selecting a skill via Ctrl+P → Skills or the prompt_skills keybind immediately invokes the skill tool and clears the existing input draft. The user's in-progress text is lost.

This is problematic for multi-skill workflows: a user writes a prompt, then wants to load a second skill (whose name they don't remember) to use alongside the first. They open the skill selector — and their draft is gone.

The problem

Selecting a skill from the selector submits a message (invokes the skill tool via session.prompt) rather than inserting /skill <name> into the input box. This means:

  1. The current draft is discarded (replaced by the skill invocation message)
  2. The user cannot compose /skill A + /skill B + their actual prompt in a single submission
  3. There is no way to browse the skill list while preserving draft text

Expected behavior

Selecting a skill from prompt_skills (or Ctrl+P) should insert /skill <name> at the cursor position in the input box (similar to how slash-command autocomplete works in autocomplete.tsx), not submit it as a standalone message. This would let users:

  • Keep their existing draft
  • Compose multiple /skill invocations with their prompt before submitting
  • Browse the skill list without fear of losing work

Steps to reproduce

  1. Type some text in the input box (e.g., "help me refactor the auth module")
  2. Press Ctrl+P → select "Skills" (or use a custom prompt_skills keybind)
  3. Select any skill (e.g., "brainstorming")
  4. Observed: The draft text is gone; the skill is invoked immediately as a standalone message
  5. Expected: /skill brainstorming is inserted into the input, preserving the draft

Environment

  • OpenCode version: 1.18.8
  • OS: macOS (Darwin)
  • prompt_skills keybind: custom (ctrl+s), but the issue reproduces with the default Ctrl+P path too

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions