Solved Unable to copy/paste on Rxvt-Unicode with perl extension

S

Sensucht94

Guest
Hello community, back to RXVT-unicode, I configured it the usual way.

In order to enable copy/paste from CLIPBOARD (I don't have middle-button function on touchpad, so can't rely on PRIMARY), I installed perl extensions. Usually I do this from muenich's on github, but since I saw the package has been ported to FreeBSD (x11/urxvt-perls), I opted for the latter.
Then I installed from github another extension I often make use of, which is majutushi's urxvt-font-size

Now if I ls /usr/local/lib/urxvt/perl, here's the content:

Code:
option-popup                    overlay-osc

background                    readline

bell-command                 remote-clipboard

block-graphics-to-ascii     searchable-scrollback

clipboard                        selection

clipboard-osc                  selection-autotransform

confirm-paste                 selection-pastebin

digital-clock                   selection-popup

eval                               selection-to-clipboard

example-refresh-hooks    tabbed

font-size                    

keyboard-select              url-select

keysym-list                     urxvt-popup

kuake                             xim-onthespot

matcher

So clipboard extension is ultimately installed.

Now here's my ~/.Xresources section related to extensions:
Code:
! extensions & keybindings
urxvt*perl-ext-common: default,clipboard,keyboard-select,url-select,font-size
urxvt*url-select.launcher: elinks
urxvt*url-select.underline: true
urxvt*url-select.autocopy: true
urxvt*url-select.button: 1
urxvt*keysym.M-u: perl:url-select:select_next
urxvt*keysym.M-c: perl:clipboard:copy
urxvt*keysym.M-v: perl:clipboard:paste
urxvt*keysym.M-Up: perl:font-size:increase
urxvt*keysym.M-Down:perl:font-size:decrease
urxvt*keysym.M-a: perl:keyboard-select:activate
urxvt*keysym.M-s perl:keyboard-select:search

Given url-select, keyboard-select, and font-size work well, yet I can't manage clipboard extension to do its work. I currently use a similar configuration in Linux, and I recall having set rxvt-unicode up likewise in FreeBSD 10.x too, where, if a I don't remember wrong, clipboard used to work.

Since I'm on Openbox, I checked my ~/.config/openbox/rc.xml for "keybind" entries that would have potentially bound Alt-C/Alt-V to another command, but search returned nothing as expected. I had done the same with ~/.fluxbox/keys when I was on Lumina, without success. What's sure is that for me it's a problem affecting not only Openbox. Keys are not bound in .tcshrc as well.

I try also to bind copy/paste to C-c/C-v instead of M-c/M-v, but still nothing.

When I launch urxvt from another terminal, no error is returned, nor any perl extension is reported missing.

I ran xmodmap to see whether or not Mod1 was associated to Alt_left, and it seems so (which is confirmed by the fact Alt works as mod1 in any other installed application):
Code:
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3
mod4        Super_L (0x73),  Super_R (0x74),  Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x8),  ISO_Level3_Shift (0x7c)
Finally, I thought it could have been a problem of CLIPBOARD and PRIMARY being wrongly adressed/inverted by rxvt, so I decided to install desktutils/autocutsel, in order to synchronize the 2 clipboards, but it clearly appears that is not the problem.

Any other idea? How do you deal with copy/paste (without mouse) in rxvt? Any suggestion is very appreciated :)
 
It just works by default. It doesn't even need Perl extensions. Default keys are C-M-c, C-M-v.
Hi, thanks for your reply! Actually I know about the defaults shortcut, mainly through urxvt(1). Still, having never found them really
comfortable, I did not go into some more in-depth reading
If you're adamant in using the clipboard extension: Do you have x11/xsel-conrad installed?
Yes, I knew x11/rxvt-perls relies on xsel by default (as stated on the extension file, I was forced to check it the first time I cloned perl extensions), so I had installed it along with RXVT-Unicode, even though, being an old x11/xclip user, I prefer using the latter in everyday life.

Actually I discovered the problem stands in the difference between the FreeBSD's xsel(1), and Linux' xsel(1). And it can be confirmed by launching urxvt from another RXVT-Unicode instance: trying to copy/paste with keybindings set in ~/.Xresources, results in errors like

Code:
error running: xsel -ob
error running :xsel -ib

My workaround was to specify the correct BSD commands in ~/.Xresources for clipboard extension to use:
Code:
!copy & paste commands
urxvt*clipboard.copycmd: xsel  -c -s clip
urxvt*clipboard.pastecmd: xsel -p -s clip

And everything worked exactly as expected
However, since I use xclip, I decided to deinstall xsel completely and replaced it with xclip in ~/.Xresources likewise:
Code:
urxvt*clipboard.copycmd: xclip  -in -sel clip
urxvt*clipboard.pastecmd: xclip -out -sel clip

I can say I'm satisfied now :)
 
Last edited by a moderator:
There are two xsel ports: the ancient x11/xsel and the newer x11/xsel-conrad. xsel-conrad is the xsel most Linux distributions package and it supports -ob and -ib just fine on FreeBSD as well.

Thanks! that explains finally why I hadn't encountered issues in the past with 10.x. Looks like I had installed x11/xsel-conrad at the time and x11/xsel now, and still thought they were the same package and did not notice the different name. I apologize for the unneeded bother then ;)
 
Back
Top