mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-04 08:07:16 -04:00
Fix clipboard clearing on Windows
This commit is contained in:
@@ -45,8 +45,8 @@ func ClipClear(oldContents string) {
|
|||||||
cmd := exec.Command("wl-paste")
|
cmd := exec.Command("wl-paste")
|
||||||
newContents, _ := cmd.Output()
|
newContents, _ := cmd.Output()
|
||||||
|
|
||||||
if oldContents == strings.TrimRight(string(newContents), "\n") {
|
if oldContents == strings.TrimRight(string(newContents), "\r\n") {
|
||||||
cmd := exec.Command("wl-copy", "-c")
|
cmd = exec.Command("wl-copy", "-c")
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ func ClipClear(oldContents string) {
|
|||||||
cmd := exec.Command("powershell.exe", "-c", "Get-Clipboard")
|
cmd := exec.Command("powershell.exe", "-c", "Get-Clipboard")
|
||||||
newContents, _ := cmd.Output()
|
newContents, _ := cmd.Output()
|
||||||
|
|
||||||
if oldContents == strings.TrimRight(string(newContents), "\n") {
|
if oldContents == strings.TrimRight(string(newContents), "\r\n") {
|
||||||
cmd := exec.Command("powershell.exe", "-c", "Set-Clipboard")
|
cmd = exec.Command("powershell.exe", "-c", "Set-Clipboard")
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user