Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that I can copy and paste text in rxvt by using the middle mouse button, but I was wondering if there was a way to define keyboard-shortcuts in the .Xdefaults for copy and pasting text.

Moreover it would be really awesome if it would be possible to select the text with the keyboard as well.


Trying to use urxvt-perls does not seem to work (maybe because of the zsh-VI-bindings?). When I try running the script from the command line I also get the following errors:

% perl keyboard-select 
Bareword "urxvt::ControlMask" not allowed while "strict subs" in use at keyboard-select line 137.
Bareword "urxvt::ControlMask" not allowed while "strict subs" in use at keyboard-select line 151.
Execution of keyboard-select aborted due to compilation errors.

Unfortunately I know nothing about a perl and have no idea if this is anyhow related to it not working in urxvt itself.strong text

share|improve this question
For pasting, there is the default shift+insert. This is a fairly universal method of pasting (in that different OSes and applications support it). – Patrick Jan 25 '12 at 23:31
up vote 6 down vote accepted

You can use urxvt-perls to enable keyboards shortcuts for copy and paste in urxvt.

Place the required scripts in /usr/lib/urxvt/perl/ and add these lines to your .X{resources,defaults}:

URxvt.perl-ext-common: ...,keyboard-select
URxvt.keysym.M-Escape: perl:keyboard-select:activate
share|improve this answer
Is there any way to see if the modules are loaded and do something? Following the github instructions does not work - or could it be that it does not work with the ZSH-vi-bindings? – Gjallar Jan 26 '12 at 18:48
It should work once you have reloaded your resources file: xrdb -merge ~/.Xresources It may be an issue with the bindings otherwise... – jasonwryan Jan 26 '12 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.