summaryrefslogtreecommitdiffstats
path: root/src/perl
diff options
context:
space:
mode:
authorroot <root>2012-09-21 22:55:56 +0000
committerroot <root>2012-09-21 22:55:56 +0000
commit3eabe3dc6377ee19cd9039c87b8fe32c956a7831 (patch)
treed1bb7c581f750f8fc1767f69336bd88615941811 /src/perl
parent636df4d549c51415650f81c2d5ebe560b53ebe39 (diff)
*** empty log message ***
Diffstat (limited to 'src/perl')
-rw-r--r--src/perl/clipboard-osc30
1 files changed, 30 insertions, 0 deletions
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
+}