Skip to content

fix(tui): restore composer shell kill shortcut - #42366

Merged
kitlangton merged 1 commit into
v2from
composer-shell-kill
Aug 13, 2026
Merged

kitlangton merged 1 commit into
v2from
composer-shell-kill

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Restore Ctrl+D shell termination from the TUI composer Shell tab when a global binding also recognizes the key.

Before / After

Before: The Shell tab rendered kill ctrl+d, but the key could be consumed before composer.shell.kill, so no DELETE /api/shell/:id request was sent and the background process continued running.

After: While the Shell tab is active, its configured Ctrl+D binding gets first refusal and dispatches the existing composer.shell.kill command. The server removes the shell and terminates its process group.

How

  • packages/tui/src/routes/session/composer/shell-tab.tsx intercepts the configured Ctrl+D shell-kill shortcut while the Shell tab is active, then dispatches the existing command.
  • packages/tui/test/cli/tui/composer-keymap.test.tsx covers a focused textarea plus the global app.exit collision and verifies the shell DELETE request.

Scope

This does not change composer focus, the shell API, or process lifecycle. The existing shell.remove path already terminates the detached process group; the bug was that the TUI never invoked it.

Testing

  • bun run test test/cli/tui/composer-keymap.test.tsx from packages/tui: 3 passed
  • bun typecheck from packages/tui: passed
  • Push hook repository typecheck: 34 packages passed
  • bun run test test/tool-shell.test.ts from packages/core: 20 passed
  • Live PTY verification with termctrl against the elected OpenCode service: opened the Shell tab, pressed Ctrl+D, observed the shell disappear, and confirmed the shell API no longer returned its ID

Flow

sequenceDiagram
    participant User
    participant ShellTab
    participant Server
    participant Process

    User->>ShellTab: Press Ctrl+D
    ShellTab->>ShellTab: Dispatch composer.shell.kill
    ShellTab->>Server: DELETE /api/shell/:id
    Server->>Process: Terminate process group
    Server-->>ShellTab: shell.deleted
Loading

@kitlangton
kitlangton force-pushed the composer-shell-kill branch from b1a1940 to 8effc2f Compare August 13, 2026 17:10
@kitlangton
kitlangton enabled auto-merge (squash) August 13, 2026 17:38
@kitlangton
kitlangton merged commit 2cf20e6 into v2 Aug 13, 2026
13 of 14 checks passed
@kitlangton
kitlangton deleted the composer-shell-kill branch August 13, 2026 17:40
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant