mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-11-08 17:57:37 -05:00
fix(clipboard): strip PowerShell carriage returns on WSL (#14216)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
+4
-1
@@ -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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user