Update tmux-yank

This commit is contained in:
Дмитрий Рамазанов 2022-05-13 23:57:00 +05:00
parent b40b4515e3
commit b1a96daa15
2 changed files with 8 additions and 2 deletions

View File

@ -16,10 +16,13 @@ display_notice() {
main() { main() {
local copy_command local copy_command
local payload
# shellcheck disable=SC2119 # shellcheck disable=SC2119
copy_command="$(clipboard_copy_command)" copy_command="$(clipboard_copy_command)"
payload="$(pane_current_path | tr -d '\n')"
# $copy_command below should not be quoted # $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 display_notice
} }
main main

View File

@ -174,7 +174,7 @@ clipboard_copy_command() {
} }
# Cache the TMUX version for speed. # 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() { tmux_is_at_least() {
if [[ $tmux_version == "$1" ]] || [[ $tmux_version == master ]]; then 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 if ((10#${current_version[i]} < 10#${wanted_version[i]})); then
return 1 return 1
fi fi
if ((10#${current_version[i]} > 10#${wanted_version[i]})); then
return 0
fi
done done
return 0 return 0
} }