Skip to content

tui: inline slash opens an empty command list #54856

Closed

Description

@OpeOginni

Description

Typing / in the middle of a prompt opens a command list showing “No matching commands”. The command list should only open when / is at the start of the prompt.

Plugins

Not specified.

OpenCode version

2.0.27

Steps to reproduce

  1. Open the TUI.
  2. Type Review this / in the prompt.
  3. Observe the empty command popup.

Screenshot and/or share link

Not attached.

Operating System

Mac

Terminal

Ghostty

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the report! I think this is a duplicate of #54190. It comes from the same cause: the TUI treats any / that follows a space as the start of a slash command, but only lists commands when the / is the first character of the prompt. So a / in the middle of a prompt opens an empty "No matching commands" popup.

    Possible duplicates and related issues, ordered by likelihood:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. OpeOginni commented on Oct 12, 2026

    @OpeOginni
    ContributorAuthor

    I guess this issue is more on the List still being displayed even if no commands is shown, rather than one relating to blocking the enter button.

  3. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the report and for clarifying! I was able to reproduce this on 2.0.27: typing Review this / in an empty prompt opens the command popup, which only shows No matching commands. It still happens on the latest dev (5683367) run from source. The recording and screenshots below show it, and the script below reproduces it.

    The likely cause is that the TUI starts the slash-command trigger for any / that follows a space, but only lists commands when the / is at the very start of the prompt, so the popup opens with nothing in it. Related: #50604 reported the same behaviour (closed without the fix being merged), and #51129 and #54468 are open PRs in this area.

    recording.mp4

    Screenshot

    Reproduction script (drive.ts)
    // Repro for anomalyco/opencode#54856: a `/` typed mid-prompt opens an empty
    // "No matching commands" popup. Run with OC_DEV=/path/to/checkout to test source.
    import { Effect } from "effect"
    import { OpenCodeDriver } from "opencode-drive"
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true, keypressOverlay: true },
      },
      ({ ui }) =>
        Effect.gen(function* () {
          yield* Effect.sleep(1500)
          yield* ui.screenshot("home")
          yield* ui.type("Review this /")
          yield* Effect.sleep(1000)
          const frame = yield* ui.capture()
          const text = JSON.stringify(frame)
          const popup = text.includes("No matching commands")
          yield* Effect.log(`"No matching commands" popup visible: ${popup}`)
          yield* ui.screenshot("inline-slash")
          yield* Effect.sleep(1000)
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions