fix(clipboard): strip PowerShell carriage returns on WSL (#14216)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
Breaker
2026-10-27 12:37:49 +01:00
committed by GitHub
co-authored by Carlo Sala
parent d2b7f557cc
commit 17a2b4c3a5
+4 -1
View File
@@ -59,7 +59,10 @@ function detect-clipboard() {
function clippaste() { cat /dev/clipboard; } function clippaste() { cat /dev/clipboard; }
elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then
function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; }
function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } function clippaste() {
setopt localoptions pipefail
powershell.exe -noprofile -command Get-Clipboard | tr -d '\r'
}
elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then
function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; } function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; }
function clippaste() { wl-paste --no-newline; } function clippaste() { wl-paste --no-newline; }