# Use a temporary file to prevent leaking the yanked data to other users
# with the command line, e.g. ps aux or top.
my ($fh, $tmp) = File::Temp::tempfile(); # dies on its own
- print $fh $screen->encode($match->{string});
+ print $fh $screen->encode($match->{value});
close $fh or die $!;
if ($config->{setting}{multiplexer} eq 'screen') {
debug $config, 'handler_url', 'started';
run_in_background($config, sub {
- my $url = defined $match->{url}
- ? $match->{url}
- : $match->{string};
-
my @cmd = map { $screen->encode($_) } (
@{$config->{setting}{browser}},
- $url,
+ $match->{value},
);
run_command($config, \@cmd);
});
$config{handler}{url} = sub {
my ($screen, $config, $match) = @_;
- my $url = defined $match->{url} ? $match->{url} : $match->{string};
- if ($url =~ m{^https://www.youtube.com/}) {
+ if ($match->{value} =~ m{^https://www.youtube.com/}) {
return run_in_background($config, sub {
- run_command($config, ['youtube-dl-wrapper', $url]);
+ run_command($config, ['youtube-dl-wrapper', $match->{value}]);
});
}
handler_url(@_);
goto RESULT; # reprocess special entries in result
}
if (defined $result->{match}) {
+ if (not defined $result->{match}->{value}) {
+ $result->{match}->{value} = $result->{match}->{string};
+ }
+
debug \%config, 'input', 'running handler';
my $handler = $config{state}{handler}; # set by user
$handler = $result->{handler} unless defined $handler; # set by mapping