Skip to content

Desktop: Run button for shell code blocks in chat (like Claude Desktop) #60875

Open

Description

@Alex046

Feature description

In Claude Desktop, bash code blocks in assistant messages have a Run (▶) button that executes the command directly in the app's terminal tab. This is very convenient for interactive commands (e.g. sudo password prompts) and keeps the agent's suggested commands one click away.

Proposed solution

Add a run button to shell code blocks (bash/sh/zsh/fish) in the Desktop session UI, executing them via the session shell. Run and copy buttons always visible, shell output auto-expands when run from the button.

This was already implemented in PR #59810 ("add run button for shell code blocks", wired through session.shell API, auto-expanded tool groups) — but it was auto-closed on 2026-10-31 by the compliance bot for a missing PR template, not on merit.

Additional context

Please consider reviving #59810 (or taking the same approach). Reference: #59810

Activity

  1. opencodejr commented on Oct 31, 2026

    @opencodejr

    Thanks for the suggestion, @Alex046! You're asking for a Run (▶) button on shell code blocks (bash/sh/zsh/fish) in Desktop chat messages. It would run the command through the session shell, keep the Run and copy buttons always visible, and expand the shell output automatically. Maintainers will consider it.

    Related items:

    This can't be built as a Desktop plugin today, because the GUI plugin SDK has no way to add buttons to code blocks in the chat.

  2. ryanmeador commented on Nov 4, 2026

    @ryanmeador

    With #61533 merged, I’d like to implement Run in terminal through CodeBlockAction in the built-in terminal plugin.

    Proposed behavior:

    • Clicking Run sends the completed shell code block, followed by Enter, to the session’s currently selected terminal and opens/focuses its tab.
    • Create a terminal only if the session has none.
    • Preserve the terminal’s current working directory and shell state. No directory changes, busy detection, or automatic switching to another terminal: this sends input as if the user pasted the command and pressed Enter.

    This targets the interactive terminal panel, not session.shell output in the conversation.

    This proposal covers desktop and web, using their shared built-in terminal plugin. A corresponding TUI action would be a separate follow-up.

    Is anyone already working on this, and would maintainers approve this approach before implementation?

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

Metadata

Metadata

Assignees

No one assigned

    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