From 75a0ea9b54dd5b04b708b2ad3e752fe26bd8d363 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/fingers.sh b/scripts/fingers.sh index ee3ec78..5f22f22 100755 --- a/scripts/fingers.sh +++ b/scripts/fingers.sh @@ -9,6 +9,9 @@ source $CURRENT_DIR/hints.sh 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 pane_input_temp=$3 @@ -98,6 +101,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