Feature request: Copy raw markdown (not rendered text) from agent buffers
I know this can be hard for agent-shell-markdown-replace-markup but couldn't resist to ask.
When I select a region in an agent buffer and copy it, I'd
like to get the raw markdown (# Title, _italic_, `code`) rather than
the rendered text.
Today, with the default in-place renderer (agent-shell-markdown-replace-markup),
inline markup is deleted from the buffer at render time, so copying can only
ever yield the stripped/rendered text — the original markdown isn't recoverable.
Tables already preserve their source via the agent-shell-markdown-table-source
text property and round-trip through copy/save, so there's a precedent.
Use case: pasting an agent's reply back into a markdown doc, issue, or another chat, where I want the formatting markers preserved.
Checklist
- [x] I agree to communicate with the author myself (not AI-generated).
- [x] I've read the README's Filing issues section.
- [x] I'm running the latest versions (fill in below).
- agent-shell version: 0.55.1
- acp.el version: 0.12.2
- ACP package version: pi-agent-acp
- Agent CLI version: n/a — feature request about rendering, agent-agnostic
lol some users don't want markup when they copy and some do. I'm doomed either way ;-)
With the new renderer we will actually have more flexibility. As you saw, we store metadata in the rendered text, so we can use it to convert to any other markup (including org and markdown).
https://github.com/xenodium/agent-shell/commit/891e8dc74712ff4afad1e9ba4c14cd62a2c18fa1 adds M-x agent-shell-copy-as-markdown, which should enable selecting any region and copying as markdown.
I tried it, it's working perfectly, thanks for your work.
Thanks for reporting back!