From 3eabe3dc6377ee19cd9039c87b8fe32c956a7831 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Sep 2012 22:55:56 +0000 Subject: *** empty log message *** --- src/perl/clipboard-osc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/perl/clipboard-osc (limited to 'src/perl') diff --git a/src/perl/clipboard-osc b/src/perl/clipboard-osc new file mode 100644 index 0000000..58d3c2b --- /dev/null +++ b/src/perl/clipboard-osc @@ -0,0 +1,30 @@ +#! perl + +=head1 NAME + +clipboard-osc - implement the clipboard operating system command sequence + +=head1 SYNOPSIS + + urxvt -pe clipboard-osc + +=head1 DESCRIPTION + +This extension implements the clipboard;copy Perl OSC. + +=cut + + +sub on_osc_seq_perl { + my ($self, $osc, $resp) = @_; + + return unless $osc =~ s/^clipboard;([^;]+)//; + + if ($1 eq "copy") { + my $text = $self->selection (); + $self->selection ($text, 1); + $self->selection_grab (urxvt::CurrentTime, 1); + } + + 1 +} -- cgit v1.2.3