summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-03 20:55:34 -0400
committerJesse Luehrs <doy@tozt.net>2018-11-03 20:55:34 -0400
commit2f1a11083bd7222eea87aacfd505ae4eac18de9a (patch)
treeaef8d36f789849a58d57dbd880e68a8f65fd2041 /bin
parente09b3333f0ea82da43768e2cdc426379855d2b0e (diff)
downloadconf-2f1a11083bd7222eea87aacfd505ae4eac18de9a.tar.gz
conf-2f1a11083bd7222eea87aacfd505ae4eac18de9a.zip
fix tmux-clipboard
not actually sure what broke here
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tmux-clipboard16
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/tmux-clipboard b/bin/tmux-clipboard
index 7f939e1..338d2a2 100755
--- a/bin/tmux-clipboard
+++ b/bin/tmux-clipboard
@@ -23,7 +23,9 @@ if ($ARGV[0] eq 'copy') {
my $selection = $ARGV[1] || 'primary';
if (fork) {
- close STDIN;
+ exec("tmux save-buffer -a $fifo_file");
+ }
+ else {
close STDOUT;
close STDERR;
@@ -37,15 +39,15 @@ if ($ARGV[0] eq 'copy') {
$clipboard->print($fifo_file->slurp);
$clipboard->close;
}
- else {
- exec("tmux save-buffer -a $fifo_file");
- }
}
elsif ($ARGV[0] eq 'paste') {
my $selection = $ARGV[1] || 'primary';
if (fork) {
- close STDIN;
+ system("tmux load-buffer -b tmux-clipboard $fifo_file");
+ exec("tmux paste-buffer -b tmux-clipboard -dp");
+ }
+ else {
close STDOUT;
close STDERR;
@@ -60,10 +62,6 @@ elsif ($ARGV[0] eq 'paste') {
$clipboard->close;
$fifo_file->spew(iomode => 'a', $contents);
}
- else {
- system("tmux load-buffer -b tmux-clipboard $fifo_file");
- exec("tmux paste-buffer -b tmux-clipboard -dp");
- }
}
else {
die "usage: $0 [copy|paste]";