Skip to content

[FEATURE]: Extensible Markdown code-block actions for GUI plugins #61187

Closed

Description

@ryanmeador

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Let built-in and third-party GUI plugins contribute actions alongside Copy on fenced code blocks in assistant messages.

Today, Copy is hardcoded in the Markdown renderer, and GUI plugins have no supported way to add code-block buttons. This prevents features such as Run in terminal from being implemented within the terminal plugin without app-specific wiring or DOM manipulation.

Proposed scope:

  • Add a code-block action registry to the GUI plugin API.
  • Let actions declare when they apply—for example, only to particular languages—and receive the original code, language, completion state, and owning session.
  • Support accessible labels, icons, and disabled/busy states, with contributions removed when their plugin unloads.
  • Refactor Copy onto the same action mechanism, preserving its existing behavior and availability without requiring a plugin.

Keep the API focused on actions rather than replacing Markdown rendering, and avoid adding per-row work when no plugin actions are registered.

Motivating use case: the built-in terminal plugin could contribute Run in terminal for shell blocks. That feature is already requested in #60875; execution semantics and terminal selection would be reviewed separately. This proposal does not enable command execution itself.

Related: #54126 proposed extensible fenced-code rendering for the TUI. This request concerns additive actions in the desktop/web Markdown UI.

Would this be an acceptable extension point before an implementation is started?

Activity

  1. opencodejr commented on Nov 2, 2026

    @opencodejr

    Thanks for the detailed proposal, @ryanmeador!

    In short, you're asking for a code-block action registry in the GUI plugin API. Built-in and third-party plugins could then add actions next to Copy on fenced code blocks in assistant messages. Actions would be filtered by language and get the code, language, completion state and session. Copy would move onto the same mechanism. You're right that this isn't possible today: Copy is built into the session-ui Markdown renderer, and GUI plugins have no hook into message code blocks. So it can't be done as a plugin yet.

    Maintainers will consider whether this is an extension point they'd accept. It's probably best to wait for their input before starting an implementation.

    Related issues:

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