This commit is contained in:
Romain Bossart 2015-03-25 23:29:02 +01:00
parent f3dcea420c
commit d09dde2f24

View file

@ -9,17 +9,12 @@
type "$command" >/dev/null 2>&1
}
check_reattach_needed() {
# lexicographic comparison
[[ "$OSTYPE" == "darwin"* ]] && [[ "${OSTYPE//darwin/}" < "14.0.0" ]]
}
clipboard_copy_command() {
# reattach-to-user-namespace is required for OS X
if command_exists "pbcopy"; then
if check_reattach_needed && command_exists "reattach-to-user-namespace"; then
if [[ "${OSTYPE//darwin/}" < "14.0.0" ]] && command_exists "reattach-to-user-namespace"; then
echo "reattach-to-user-namespace pbcopy"
elif ! check_reattach_needed; then
elif [[ "${OSTYPE//darwin/}" > "13.0.0" ]]; then
echo "pbcopy"
fi
elif command_exists "xclip"; then