Don't call in to xclip when $DISPLAY isn't available.
This commit is contained in:
parent
91de69b8c7
commit
faa4fab7c0
@ -121,7 +121,7 @@ function oscopy() {
|
||||
then
|
||||
reattach-to-user-namespace pbcopy
|
||||
else
|
||||
xclip -selection c
|
||||
test -n "$DISPLAY" && xclip -selection c
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -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 () {
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user