1
0
mirror of https://github.com/Morantron/tmux-fingers.git synced 2024-06-21 06:56:43 +02:00

add @fingers-copy-command option

This commit is contained in:
Jorge Morante 2016-05-12 09:11:58 +02:00
parent 22a660bc77
commit 9e04dc6e0a

View File

@ -5,6 +5,8 @@ source $CURRENT_DIR/config.sh
source $CURRENT_DIR/actions.sh
source $CURRENT_DIR/hints.sh
FINGERS_COPY_COMMAND=$(tmux show-option -gqv @fingers-copy-command)
current_pane_id=$1
fingers_pane_id=$2
tmp_path=$3
@ -32,15 +34,20 @@ function handle_exit() {
function copy_result() {
local result=$1
clear
echo -n "$result"
start_copy_mode
top_of_buffer
start_of_line
start_selection
end_of_line
cursor_left
copy_selection
if [ -z $FINGERS_COPY_COMMAND ]; then
clear
echo -n "$result"
start_copy_mode
top_of_buffer
start_of_line
start_selection
end_of_line
cursor_left
copy_selection
else
echo -n "$result" | $FINGERS_COPY_COMMAND
fi
}
trap "handle_exit" EXIT