make the charpage optional

This commit is contained in:
amtoine 2023-08-19 09:38:58 +02:00
parent fe7122280d
commit 821e50c4b0
No known key found for this signature in database
GPG Key ID: 37AAE9B486CFF1AB

View File

@ -142,6 +142,7 @@ export def clip [
--no-notify: bool # do not throw a notification (only on linux)
--no-strip: bool # do not strip ANSI escape sequences from a string
--expand (-e): bool # auto-expand the data given as input
--charpage (-c): int # the id of the charpage to use (only on Windows), see https://en.wikipedia.org/wiki/Windows_code_page, e.g. 65001 is for UTF-8
] {
let input = (
$in
@ -161,7 +162,9 @@ export def clip [
}
},
"windows" => {
chcp 65001 # see https://discord.com/channels/601130461678272522/601130461678272524/1085535756237426778
if $charpage != null {
chcp $charpage
}
check-clipboard clip.exe --system $"('xorg' | pretty-command) on linux"
$input | clip.exe
},