From 2f1a11083bd7222eea87aacfd505ae4eac18de9a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 3 Nov 2018 20:55:34 -0400 Subject: fix tmux-clipboard not actually sure what broke here --- bin/tmux-clipboard | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'bin') 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]"; -- cgit v1.2.3-54-g00ecf