| 1 |
#! perl |
| 2 |
|
| 3 |
#:META:OSC_PERL:clipboard:man clipboard-osc |
| 4 |
|
| 5 |
=head1 NAME |
| 6 |
|
| 7 |
clipboard-osc - implement the clipboard operating system command sequence |
| 8 |
|
| 9 |
=head1 SYNOPSIS |
| 10 |
|
| 11 |
urxvt -pe clipboard-osc |
| 12 |
|
| 13 |
=head1 DESCRIPTION |
| 14 |
|
| 15 |
This extension implements the clipboard;copy Perl OSC. |
| 16 |
|
| 17 |
=cut |
| 18 |
|
| 19 |
|
| 20 |
sub on_osc_seq_perl { |
| 21 |
my ($self, $osc, $resp) = @_; |
| 22 |
|
| 23 |
return unless $osc =~ s/^clipboard;([^;]+)//; |
| 24 |
|
| 25 |
if ($1 eq "copy") { |
| 26 |
my $text = $self->selection (); |
| 27 |
$self->selection ($text, 1); |
| 28 |
$self->selection_grab (urxvt::CurrentTime, 1); |
| 29 |
} |
| 30 |
|
| 31 |
1 |
| 32 |
} |