commit aae7d399b9449bc30aa8088d5b2191d5f6b73390
parent 9e3be00851ee670a76ec4ced82f973091a7c9cbd
Author: Markus Meier <markus.d.meier@gmail.com>
Date: Tue, 4 Feb 2025 21:03:08 +0100
fix: remove carriage return in WSL
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/plugins/x2sel b/plugins/x2sel
@@ -8,7 +8,7 @@
# - pbpaste (macOS)
# - termux-clipboard-get (Termux)
# - powershell (WSL)
-# - cygwim's /dev/clipboard (Cygwin)
+# - cygwin's /dev/clipboard (Cygwin)
# - wl-paste (Wayland)
# - clipboard (Haiku)
#
@@ -26,6 +26,9 @@ getclip () {
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
# Wayland
wl-paste
+ elif type powershell.exe >/dev/null 2>&1; then
+ # WSL
+ powershell.exe -noprofile -command Get-Clipboard | tr -d '\r'
elif type xsel >/dev/null 2>&1; then
# Linux
xsel -bo
@@ -38,9 +41,6 @@ getclip () {
elif type termux-clipboard-get >/dev/null 2>&1; then
# Termux
termux-clipboard-get
- elif type powershell.exe >/dev/null 2>&1; then
- # WSL
- powershell.exe Get-Clipboard
elif [ -r /dev/clipboard ] ; then
# Cygwin
cat /dev/clipboard