Skip to content

Cannot interrupt/stop long-running commands executed via the bash tool #37007

Description

@simonsuiqi-ops

Description

Describe the bug
When opencode runs a long-running foreground command (e.g. a dev server: npm run dev, uvicorn app.main:app --reload) through the bash tool, the command blocks indefinitely and there is no way to interrupt or stop it. opencode appears stuck until the command times out, and the spawned process often keeps running in the background even after the timeout.
To Reproduce

  1. Ask opencode to start a dev server, e.g. run npm run dev (a blocking process) in a project.
  2. The bash tool runs the command and blocks.
  3. There is no Ctrl+C / stop button / interrupt mechanism available.
  4. opencode hangs until the 120s timeout; the dev server process keeps running afterward.
    Expected behavior
    A way to interrupt/stop the currently running command (Ctrl+C equivalent or a stop/abort action), so long-running processes don't block opencode, and so the user can cleanly terminate foreground servers they started.
    Environment
  • OS: Windows (win32), PowerShell 5.1
  • opencode version: (fill in)
    Additional context
    Workaround used: launch servers in separate background windows (e.g. start "title" cmd /k ... on Windows) so the bash call returns immediately. But native support for interrupting foreground commands would be much better. Ideally, expose a stop/interrupt action that sends an interrupt signal (Ctrl+C / CTRL_BREAK on Windows) to the running process and lets opencode resume without waiting for the full timeout.

Plugins

Shell,VSCode

OpenCode version

Latest

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions