+
+ if ($config->{setting}{yank_x11}) {
+ $screen->debug('handler_yank', 'setting X11 selection');
+
+ my @xsel_cmd = qw( xsel --input --primary );
+ my @xclip_cmd = qw( xclip -in -selection primary );
+
+ my $fh;
+ {
+ # We don't care if a program doesn't exist.
+ no warnings;
+
+ if (not open $fh, '|-', @xsel_cmd) {
+ if (not open $fh, '|-', @xclip_cmd) {
+ die "install xsel or xlip to yank to X11 selection\n";
+ }
+ }
+ }
+ print $fh $match->{value} or die $!;
+ close $fh or die $!;
+ }
+