rxvt-unicode Digest, Vol 73, Issue 1

Charles rxvt-unicode at catcons.co.uk
Tue Jun 7 06:17:19 CEST 2011


On 03/06/11 15:30, rxvt-unicode-request at lists.schmorp.de wrote:
> Date: Thu, 2 Jun 2011 23:49:39 -0500
> From: Trey Blancher <trey at blancher.net>
> To: rxvt-unicode at lists.schmorp.de
> Subject: Problem with executing keysym events
> Message-ID: <BANLkTin4y3Gm7H5QeXqkfbL9KfsFWBgPZQ at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I have two issues. One, the clipboard copy event is triggered, but it
> appears the code is not executed. Also, the new_tab event is
> triggered, but the standard urxvt::tabbed new_tab sub doesn't appear
> to be executed
>
> I have the following in .Xdefaults:
>
> URxvt.perl-lib: /home/trey/urxvt
> !... other stuff omitted
> URxvt.keysym.Shift-Control-C: perl:clipboard:copy
> URxvt.keysym.Shift-Control-V: perl:clipboard:paste
> URxvt.keysym.Shift-Control-T: perl:tabbed:new_tab
>
> And I have the following ~/urxvt/clipboard
>
> #! perl
> sub on_sel_grab {
> my $query = $_[0]->selection;
> open (my $pipe,'| /usr/bin/xclip -in -selection primary') or die;
> print $pipe $query;
> close $pipe;
> }
>
> # the following is my effort to get clipboard copy working.
> sub copy {
> urxvt::warn "DEBUG: Entering clipbooard:copy sub..." ;
> my $query = $_[0]->selection;
> #open (my $pipe,'| /usr/bin/xclip -in -selection clipboard') or die;
> #open (my $pipe,'| /usr/bin/xsel --input --clipboard') or die;
> urxvt::warn "DEBUG: Calling xsel..." ;
> system("echo $query | /usr/bin/xsel --input --clipboard") ;
> #urxvt::warn "DEBUG: \$trash = $trash" ;
> #print $pipe $query;
> #close $pipe;
> }
> sub paste {
> my ($self) = @_;
>
> my $content = `/usr/bin/xclip -loop 1 -out -selection clipboard` ;
> $self->tt_write ($content);
> }
> sub on_user_command {
> my ($self, $cmd) = @_;
> if ($cmd eq "clipboard:paste") {
> $self->paste;
> }
> }
>
> I have launched urxvt with "URXVT_PERL_VERBOSITY=11 urxvt", and all
> the perl modules are loading with no problems as far as I can tell.
> During troubleshooting, I'd break the clipboard module, and none of
> the modules would load. With all the modules loaded properly I get
> the following events when the keysyms fail:
>
>
> urxvt: USER_COMMAND (urxvt::term=HASH(0x294d3c0), clipboard:copy)
> urxvt: USER_COMMAND returning <>
> ...
> urxvt: USER_COMMAND (urxvt::term=HASH(0x294d3c0), tabbed:new_tab)
> urxvt: USER_COMMAND returning <>
>
> None of the debug code I entered show up, which leads me to believe
> it's not getting executed. What's so maddening about this, is when I
> copy something to the clipboard in another window, and hit
> CTRL-SHIFT-V in urxvt, it pastes as expected, and I see the following
> event in the debug:
>
> urxvt: USER_COMMAND (urxvt::term=HASH(0x294d3c0), clipboard:paste)
> urxvt: USER_COMMAND returning <>
>
> As far as I can tell, there's no difference, it's just not executing
> the clipboard:copy or tabbed:new_tab code, and I can't figure out why.
> I'm coming from gnome-terminal, and I see a lot of promise with
> urxvt, but not having a point-and-click GUI makes it rather opaque.
> Not that I'm suggesting it should have a point and click GUI, it just
> takes longer to come up to speed.

Hello :-)

I'm no expert but it has been a while since you posted and I do know a 
little about copy+paste ...

urxvt normally uses Control+Shift to open a dialogue for entering 
characters by hex code (or something like that -- I have never used it) 
and AFAIK this is not configurable during build so it is surprising that 
your URxvt.keysym.Shift-Control-C line results in running clipboard:copy 
as shown when running with URXVT_PERL_VERBOSITY=11.  How did you install 
urxvt?

urxvt follows the X convention of automatically copying text selected by 
the user to the PRIMARY buffer.  Other applications following the X 
convention can paste from there but most desktop applications paste from 
the CLIPBOARD buffer (most commonly with Control+V).  This creates the 
convenient possibility of configuring/customising urxvt to automatically 
copy text selections to the CLIPBOARD buffer, thus doing away with the 
need for you to use a key combination to copy selected text ready for 
pasting.

If you are interested I can upload my own files somewhere which do 
exactly as above and use Super/Windows+V to paste into urxvt.

Best

Charles





More information about the rxvt-unicode mailing list