mirror of
https://github.com/nushell/nushell.git
synced 2025-06-02 08:06:12 +02:00
use a match on the OS name
This commit is contained in:
parent
9cd3c951f8
commit
c6acc47092
@ -450,15 +450,21 @@ export def clip [
|
|||||||
$input | ansi strip
|
$input | ansi strip
|
||||||
} else { $input }
|
} else { $input }
|
||||||
|
|
||||||
if not (which clip.exe | is-empty) {
|
match $nu.os-info.name {
|
||||||
chcp 65001 # see https://discord.com/channels/601130461678272522/601130461678272524/1085535756237426778
|
"linux" => {
|
||||||
$input | clip.exe
|
if ($env.WAYLAND_DISPLAY? | is-empty) {
|
||||||
} else if ($env.WAYLAND_DISPLAY? | is-empty) {
|
check-clipboard xclip --system $"('xorg' | pretty-command) on linux"
|
||||||
check-clipboard xclp --system $"('xorg' | pretty-command) on linux"
|
$input | xclip -sel clip
|
||||||
$input | xclip -sel clip
|
} else {
|
||||||
} else {
|
check-clipboard wl-copy --system $"('wayland' | pretty-command) on linux"
|
||||||
check-clipboard wl-copy --system $"('wayland' | pretty-command) on linux"
|
$input | wl-copy
|
||||||
$input | wl-copy
|
}
|
||||||
|
},
|
||||||
|
"windows" => {
|
||||||
|
chcp 65001 # see https://discord.com/channels/601130461678272522/601130461678272524/1085535756237426778
|
||||||
|
check-clipboard clip.exe --system $"('xorg' | pretty-command) on linux"
|
||||||
|
$input | clip.exe
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if not $silent {
|
if not $silent {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user