This is generally a topic of discussion between new Urxvt users that how do you copy/paste text in Urxvt terminal emulator. The forums and discussion boards are filled with hundreds of topics of this kind and the methods described there not always work for every user. So today I am posting the method which I am using for a long time, it always works for me and it is easier to use too.
1. Install xclip:
Since I use Archlinux
#pacman -S xclip
For CentOS/RHEL users “xclip” is in RPMforge repository.
For Ubuntu/Debian users it is in your official repositories.
2. Copy this perl script in your /usr/lib/urxvt/perl/ with the “clipboard” name :
#cp urxvtclip /usr/lib/urxvt/perl/clipboard
NOTE: If you are using a 64 bit operating system chances are that your perl library path may be /usr/lib64 instead of /usr/lib. So double check your path before proceeding.
3. Now add these lines to your .Xdefaults or .Xresources (whatever you use) :
URxvt.keysym.Shift-Control-V: perl:clipboard:paste URxvt.iso14755: False URxvt.perl-ext-common: default,clipboard
The first line binds ^+shift+V to “clipboard” extension and the second line disables iso14755 mode. Look at the last line in the above code make sure that your .Xdefaults or .Xresources does not already contain URxvt.perl-ext-common line. If it does then just add “clipboard” to it, copy rest of the lines and you are done.
Copying text :
To copy the text just select the text with mouse and it will automatically be copied to your clipboard then you can paste the text anywhere you want with Coltrol + V.
Pasting text :
To paste the text in URxvt simply use Control + Shift + V.
If you have any comment or suggestion let me know and leave a reply.
Can someone post this script ? The URL is not working. Thanks
Here is the pastebin link
https://pastebin.com/QHk1NyPS
Hi, I appreciated the article. Unfortunately the dropbox link to the perl script has broken (from point #2).
The link to that perl script is 404
I updated the link. It is working now. Sorry for the delay.
2016, it works like a charm. Thank you!
I am glad the script is still working.
Thank you for this, been trying forever for something simple, this totally works and is dead simple.
Thanks!
Thanks for this… One that actually works.
Thanks! finally one that works!
Really awesome ! Thank you very much 🙂
This seems like a more mature version of the above Perl script: https://github.com/muennich/urxvt-perls
fantastic, thanks!
Thank you so much!
Thanks for this.
Copying from a rvxt-unicode terminal wasn’t working and now it does!
helpful! i love reading your articles, thanks for all.