Pass current_pane_id as a parameter to copy command

Passing this variable allows the copy command to interact with the
current pane (tmux send-keys, for example).
This commit is contained in:
Raimon Grau 2018-12-02 14:19:35 +00:00
parent 43a09978c4
commit a11afa8756
1 changed files with 10 additions and 2 deletions

View File

@ -124,10 +124,18 @@ function copy_result() {
is_uppercase=$(echo "$input" | grep -E '^[a-z]+$' &> /dev/null; echo $?)
copy_command_parameters=<<-EOS
printf \"$result\" |
IS_UPPERCASE=$is_uppercase
HINT=$hint
CURRENT_PANE_ID=$current_pane_id
$exec_prefix
EOS
if [[ $is_uppercase == "1" ]] && [ ! -z "$FINGERS_COPY_COMMAND_UPPERCASE" ]; then
tmux run-shell -b "printf \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND_UPPERCASE"
tmux run-shell -b "$copy_command_parameters $FINGERS_COPY_COMMAND_UPPERCASE"
elif [ ! -z "$FINGERS_COPY_COMMAND" ]; then
tmux run-shell -b "printf \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND"
tmux run-shell -b "$copy_command_parameters $FINGERS_COPY_COMMAND"
fi
if [[ $HAS_TMUX_YANK = 1 ]]; then