copy-paste is including the prompt

67 views
Skip to first unread message

Cosmos Nicolaou

unread,
Nov 13, 2025, 10:47:00 PMNov 13
to iterm2-discuss
Hi,

I'm using 3.6.5, zsh and oh-my-posh. shell integration seems to be working in that I can see the commands in the toolbelt and features like command info work fine. The only thing that doesn't work is copy-paste across multiple command invocations is including the prompts. I seem to remember that this worked before I switched to my on-my-posh but I'm not 100% sure. What else could be going wrong or this just expected to work? Thanks.

Cheers, Cos.

George Nachman

unread,
Nov 14, 2025, 12:30:48 AMNov 14
to iterm2-...@googlegroups.com
I don’t understand precisely what is not working. Maybe a screen capture video would help?

--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/iterm2-discuss/43ab3bee-5265-47d8-af47-02d658c5a49an%40googlegroups.com.

Cosmos Nicolaou

unread,
Nov 15, 2025, 4:02:57 PMNov 15
to iterm2-discuss

Hi George,

I've attached two screenshots, one that shows commands as entered and that the toolbelt recognizes the commands, and a second that shows the result of copy/pasting into a vi window. You can see that the prompt is captured by the copy operation. Is this what you would expect, or would you expect iterm to filter out the prompts from the text being copied?

Cheers, Cos.
Screenshot 2025-11-14 at 11.11.22 AM.png
Screenshot 2025-11-14 at 11.10.15 AM.png

George Nachman

unread,
Nov 18, 2025, 2:58:02 PMNov 18
to iterm2-...@googlegroups.com
Are you selecting multiple commands at once and doing Edit > Copy? That will copy the prompts. If that is indeed what you’re doing, what’s the use case for copying multiple commands’ output? How would you want them delimited?

On Nov 13, 2025 at 5:34:07 PM, Cosmos Nicolaou <cosmos....@gmail.com> wrote:
--

Cosmos Nicolaou

unread,
Nov 21, 2025, 1:16:32 PMNov 21
to iterm2-discuss
On Tuesday, November 18, 2025 at 11:58:02 AM UTC-8 George Nachman wrote:
Are you selecting multiple commands at once and doing Edit > Copy?
 
yes!
 
That will copy the prompts. If that is indeed what you’re doing, what’s the use case for copying multiple commands’ output? How would you want them delimited?

I find myself cut-n-pasting into the various ai chatbots with multiple lines of command and output and it would be nice the prompts where omitted. So for:

promp> command0 <rprompt
output0
prompt> command1 <rprompt
output1

where to be pasted as

$ command0
output0
$ command1
output1

the funny thing is that gemini and chatgpt think this is what iterm2 does already and refer to various non-existent settings to control this behaviour!!

Cheers, Cos. 

George Nachman

unread,
Nov 25, 2025, 3:52:13 PMNov 25
to iterm2-...@googlegroups.com
That’s an interesting problem. It feels like a specific instance of something more general - like an Advanced Copy feature - but I can’t quite put my finger on what it would be.

Cosmos Nicolaou

unread,
Dec 1, 2025, 2:47:07 PM (12 days ago) Dec 1
to iterm2-...@googlegroups.com
I find myself cut-and-pasting to/from AI chatbots a lot and I suspect I'm not alone in that. I'd argue that the more general feature is easing integration with them. It wouldn't be unreasonable for iterm to offer a 'share with ai of your choice feature' to make it easy to ask questions of what's going on in the terminal. A little like github offers an 'explain this error' button in CI logs.

You received this message because you are subscribed to a topic in the Google Groups "iterm2-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iterm2-discuss/cLlv3nOyHmo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iterm2-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/iterm2-discuss/CAB5RqomiUXgky5uEBoWzmmrXparq8tq%2Bq69QQQVSNG1WqZHsSw%40mail.gmail.com.

George Nachman

unread,
Dec 2, 2025, 12:08:14 AM (12 days ago) Dec 2
to iterm2-...@googlegroups.com
A lot has already gone into integration. There is a chat UI (Window > AI Chats) that lets the agent read the contents and run commands. It supports five different vendors’ APIs, and there is also Edit > Explain Output with AI. But perhaps this is not easily discoverable or I have missed some obvious integration points? Let me know what you looked for.

Cosmos Nicolaou

unread,
Dec 3, 2025, 2:42:55 PM (10 days ago) Dec 3
to iterm2-...@googlegroups.com

I generally cut-and-paste to a gemini, chatgpt, etc chat window in a browser. I see that you have a plugin that enables AI chat within iterm2, but that won't help me with my broader use case. Anyway, if you don't think it's worthwhile then that's fine, I'll find another way. Thanks for developing and supporting iterm!



Reply all
Reply to author
Forward
0 new messages