03a0d5bbaedc732436b5c67b166cde954817cc2f

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

fix(clipboard): load clipboard on usage

Closes #8827

Diff

 1diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
 2index 2f3b6bcad2963001f0aa5f53130500185feb7e3e..4b37abc9bab4e9993fd0655bd5fd357cc2f23ab3 100644
 3--- a/lib/clipboard.zsh
 4+++ b/lib/clipboard.zsh
 5@@ -100,8 +100,8 @@ function detect-clipboard() {
 6   fi
 7 }
 8 
 9-# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set,
10-# which is not really an error. If the user calls them, they will attempt to redetect
11-# (for example, perhaps the user has now installed xclip) and then either print an error
12-# or proceed successfully.
13-detect-clipboard || true
14+function clipcopy clippaste {
15+  unfunction clipcopy clippaste
16+  detect-clipboard || true # let one retry
17+  "$0" "$@"
18+}