r/PiCodingAgent • u/xpgmi • Oct 16 '26
Question Is it possible to make pi coding agent copy and paste friendly?
Serious question, I mean I want to be able to select the text printed on the console so that I can paste the text to another place.
4
Upvotes
5
u/xpgmi Oct 16 '26
An update, I can copy and paste already, it just the settings issue, I asked Pi itself to resolve the settings issue. Thanks everyone.
1
u/adamshand Oct 16 '26
this works by default. if it isn't it's something about your setup.
the only trick is that if you are macos you need to use ctrl-v to paste images.
3
u/moofish2842 Oct 16 '26
pi --tui-mode regular
3
u/bitzap_sr Oct 17 '26
Press shift.
5
u/DanielSReichenbach Oct 16 '26
pi.dev provides the exact settings in their docs to make this work for common terminals actually.
https://pi.dev/docs/latest/terminal-setup describes what works, where and how to configure.
2
u/Lissanro Oct 16 '26 edited Oct 16 '26
I have encountered this issue with copy/paste too when started using Pi few months ago... I often need cleanly copy multi-line text, to either copy command to try in my a terminal, or to quote to reply to a certain part of the message. Then I needed some more features that were not yet available... And so I ended up maintaining my own customized Pi Crystal fork for a while now - you can check it out at https://github.com/Lissanro/pi if interested (I usually update it every few weeks, merging mainline Pi patches), it has quite a few extra features like editing messages, continuing mid-thought, being able to copy rendered text without padding, deleting/restoring messages, support for regenerating and message versioning, etc. It takes some effort to sync periodically with mainline but still I find Pi better foundation than any other current harness.
4
u/rinaldorex Oct 16 '26
Try herdr. It's a joy to use on the terminal.
1
u/mocras Oct 21 '26
Use Pi inside Tmux. Pi 1.0 comes with a new TUI mode that lets you just highlight text and it gets copied right away. But with the old TUI mode you can configure tmux to archive the same. Or press shift while dragging. This should bypass any application and let your terminal select and copy text.
1
u/touilleMan Oct 16 '26
Pi uses an escape sequence to copy into the clipboard, this is not supported by vterm-based terminals (e.g. gnome-terminal, tilda etc.)
The issue is that the terminal doesn't confirm that the copy was successful (this is by design for security reasons, just like why vterm doesn't support this)
However in recent pi versions they now also try to use copy command exposed by x11/wayland if available. But this still doesn't work if you don't have accyto a running display server (typically when you use ssh)
Now a solution: you can press shift while doong the selection to have your terminal do the selection (instead you letting pi capture the mouse inputs), then you can do ctrl+shift+c. The drawback with this solution is that your copied text contain a ton of trailing whitespaces so you have to paste it on your text editor and remove that manually (multi cursor works great for this btw)
1
u/russlixx Oct 16 '26
it already is, if you use mac os, try ctrl + v. Sometimes cmd + v doesnt paste well for some things. You can also drag n drop too, it paste the pathname
1
u/EC36339 Oct 16 '26
1
u/funbike Oct 16 '26
What terminal are you using?
Imagine asking a website to support copy and paste. It would be a silly request, because all websites support copy and paste because that's built into all web browsers. It's similar with Pi; copy-paste is supported by your terminal.
Many (not all) terminals use ctrl+shift+v for paste and ctrl+shift+c for copy.
Pi has a
/copycommand that copies the last agent message to the clipboard, so you don't have to do anything with the mouse.0
u/jackorjek Oct 16 '26
i can select any text and it auto copy for me. should be working for you as well.
0
u/[deleted] Oct 16 '26
[deleted] — view deleted comment