Don't call in to xclip when $DISPLAY isn't available.

This commit is contained in:
Ivan Malison 2014-12-12 00:01:10 -08:00
parent 91de69b8c7
commit faa4fab7c0
3 changed files with 8 additions and 8 deletions

View File

@ -121,7 +121,7 @@ function oscopy() {
then
reattach-to-user-namespace pbcopy
else
xclip -selection c
test -n "$DISPLAY" && xclip -selection c
fi
}

View File

@ -1,32 +1,32 @@
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-backward-kill-word () {
zle backward-kill-word
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-kill-word () {
zle kill-word
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-kill-buffer () {
zle kill-buffer
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-copy-region-as-kill-deactivate-mark () {
zle copy-region-as-kill
zle set-mark-command -n -1
echo -n $CUTBUFFER | clipboard
echo -n $CUTBUFFER | oscopy
}
pb-yank () {

View File

@ -24,5 +24,5 @@ bind-key / resize-pane -L 3
bind-key - resize-pane -U 3
bind-key * resize-pane -R 3
bind-key -t emacs-copy M-w copy-pipe "zsh -c 'clipboard'"
bind-key -t emacs-copy M-w copy-pipe "zsh -c 'oscopy'"
source ~/.tmux.powerline