From 21c6c06d65443389156ede7594861207c469857b Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Wed, 19 Apr 2017 22:52:55 +0200 Subject: [PATCH] make tmux-yank integration work with new set-buffer approach --- scripts/fingers.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/fingers.sh b/scripts/fingers.sh index bdddb4c..2a0fd40 100755 --- a/scripts/fingers.sh +++ b/scripts/fingers.sh @@ -8,6 +8,7 @@ source $CURRENT_DIR/utils.sh source $CURRENT_DIR/help.sh FINGERS_COPY_COMMAND=$(tmux show-option -gqv @fingers-copy-command) +HAS_TMUX_YANK=$([ "$(tmux list-keys | grep -c tmux-yank)" == "0" ]; echo $?) current_pane_id=$1 fingers_pane_id=$2 @@ -98,6 +99,12 @@ function copy_result() { if [ ! -z "$FINGERS_COPY_COMMAND" ]; then echo -n "$result" | eval "nohup $FINGERS_COPY_COMMAND" > /dev/null fi + + if [[ $HAS_TMUX_YANK = 1 ]]; then + tmux_yank_copy_command=$(tmux list-keys -t vi-copy | grep "vi-copy *y" | sed 's/.*copy-pipe "\(.*\)".*/\1/g') + + echo -n "$result" | eval "nohup $tmux_yank_copy_command" > /dev/null + fi } while read -rsn1 char; do