From b1a96daa15fbb6e26f8057b5181fe3a56cb5c696 Mon Sep 17 00:00:00 2001 From: EoF Date: Fri, 13 May 2022 23:57:00 +0500 Subject: [PATCH] Update tmux-yank --- tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh | 5 ++++- tmux/plugins/tmux-yank/scripts/helpers.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh b/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh index 07b6f95..1db321f 100755 --- a/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh +++ b/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh @@ -16,10 +16,13 @@ display_notice() { main() { local copy_command + local payload # shellcheck disable=SC2119 copy_command="$(clipboard_copy_command)" + payload="$(pane_current_path | tr -d '\n')" # $copy_command below should not be quoted - pane_current_path | tr -d '\n' | $copy_command + echo "$payload" | $copy_command + tmux set-buffer "$payload" display_notice } main diff --git a/tmux/plugins/tmux-yank/scripts/helpers.sh b/tmux/plugins/tmux-yank/scripts/helpers.sh index c80a93f..66beeec 100644 --- a/tmux/plugins/tmux-yank/scripts/helpers.sh +++ b/tmux/plugins/tmux-yank/scripts/helpers.sh @@ -174,7 +174,7 @@ clipboard_copy_command() { } # Cache the TMUX version for speed. -tmux_version="$(tmux -V | cut -d ' ' -f 2)" +tmux_version="$(tmux -V | cut -d ' ' -f 2 | sed 's/next-//')" tmux_is_at_least() { if [[ $tmux_version == "$1" ]] || [[ $tmux_version == master ]]; then @@ -200,6 +200,9 @@ tmux_is_at_least() { if ((10#${current_version[i]} < 10#${wanted_version[i]})); then return 1 fi + if ((10#${current_version[i]} > 10#${wanted_version[i]})); then + return 0 + fi done return 0 }