diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-14 19:54:42 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-14 19:54:42 -0600 |
commit | a16fe1511ccf698432b7bbaccf250a7739ed2a92 (patch) | |
tree | ee5e6ed90702bf1691bd580a09c1745d898f768b /lib/clipboard.zsh | |
parent | a2baf45bce6bb8b501512233441af8f65f90a775 (diff) | |
parent | 31a84e710f2006176402be6b76ce370dabfc95d3 (diff) | |
download | zsh-a16fe1511ccf698432b7bbaccf250a7739ed2a92.tar.gz zsh-a16fe1511ccf698432b7bbaccf250a7739ed2a92.tar.bz2 zsh-a16fe1511ccf698432b7bbaccf250a7739ed2a92.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'lib/clipboard.zsh')
-rw-r--r-- | lib/clipboard.zsh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index b663800a4..2c93d1bb5 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -31,13 +31,13 @@ function clipcopy() { cat $file > /dev/clipboard fi else - if which xclip &>/dev/null; then + if (( $+commands[xclip] )); then if [[ -z $file ]]; then xclip -in -selection clipboard else xclip -in -selection clipboard $file fi - elif which xsel &>/dev/null; then + elif (( $+commands[xsel] )); then if [[ -z $file ]]; then xsel --clipboard --input else @@ -74,9 +74,9 @@ function clippaste() { elif [[ $OSTYPE == cygwin* ]]; then cat /dev/clipboard else - if which xclip &>/dev/null; then + if (( $+commands[xclip] )); then xclip -out -selection clipboard - elif which xsel &>/dev/null; then + elif (( $+commands[xsel] )); then xsel --clipboard --output else print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 |