Run button on shell code blocks in chat #10772
GabrieleCurti
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web
Problem or use case
Copy is the only action on a code block right now. When the agent tells you to run something, you copy it, open the terminal drawer, click in, paste, hit enter. Every single time.
Expected behavior
A run button next to copy on shell code blocks in chat. Click it, it opens (or reuses) the thread's terminal at the project cwd and writes the command, same as clicking a saved project script.
Smallest useful scope
Web only. Add the button to the existing
MarkdownCodeBlocktoolbar (it already has copy and wrap), thread a callback throughChatMarkdownRendererContext, reuserunProjectScript(ChatView.tsx) for the actual terminal open/write. Restrict to shell-language fences for the first pass, not multi-line scripts or non-shell languages.Someone already tried this in #472, closed without merging, no comment on why. It's six months stale now,
ChatMarkdown.tsxchanged shape since (the toolbar didn't exist back then), so a new attempt wouldn't reuse much of that diff.Mobile renders code blocks through a separate native module that only has copy today, no shared code with web's markdown pipeline. Worth doing later, not blocking this.
Why this matters
Agents propose a shell command in basically every session that touches setup, tests, migrations, or git. It's one of the most repeated actions in the whole product, and right now it's copy, switch tabs, paste, enter, every time. On mobile it's worse: switching tabs and tapping into a PTY input on a phone keyboard. Copy-paste also has a real failure mode, retyping or pasting into the wrong terminal or cwd. A button removes basically all of that for the single most common "close the loop" step in a session.
Contribution
For more context
#472
All reactions