File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 8
8
# - pbpaste (macOS)
9
9
# - termux-clipboard-get (Termux)
10
10
# - powershell (WSL)
11
- # - cygwim 's /dev/clipboard (Cygwin)
11
+ # - cygwin 's /dev/clipboard (Cygwin)
12
12
# - wl-paste (Wayland)
13
13
# - clipboard (Haiku)
14
14
#
@@ -26,6 +26,9 @@ getclip () {
26
26
if [ " $XDG_SESSION_TYPE " = " wayland" ]; then
27
27
# Wayland
28
28
wl-paste
29
+ elif type powershell.exe > /dev/null 2>&1 ; then
30
+ # WSL
31
+ powershell.exe -noprofile -command Get-Clipboard | tr -d ' \r'
29
32
elif type xsel > /dev/null 2>&1 ; then
30
33
# Linux
31
34
xsel -bo
@@ -38,9 +41,6 @@ getclip () {
38
41
elif type termux-clipboard-get > /dev/null 2>&1 ; then
39
42
# Termux
40
43
termux-clipboard-get
41
- elif type powershell.exe > /dev/null 2>&1 ; then
42
- # WSL
43
- powershell.exe Get-Clipboard
44
44
elif [ -r /dev/clipboard ] ; then
45
45
# Cygwin
46
46
cat /dev/clipboard
@@ -52,9 +52,15 @@ getclip () {
52
52
53
53
CLIPBOARD=$( getclip)
54
54
55
+ if [ -z " $CLIPBOARD " ]; then
56
+ echo " No content in clipboard"
57
+ exit 1
58
+ fi
59
+
55
60
# Check if clipboard actually contains a file list
56
61
for file in $CLIPBOARD ; do
57
62
if [ ! -e " $file " ] ; then
63
+ echo " '$file ' is not a file"
58
64
exit 1;
59
65
fi
60
66
done
You can’t perform that action at this time.
0 commit comments