mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-30 13:56:37 -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")
|
||||
newContents, _ := cmd.Output()
|
||||
|
||||
if oldContents == strings.TrimRight(string(newContents), "\n") {
|
||||
cmd := exec.Command("wl-copy", "-c")
|
||||
if oldContents == strings.TrimRight(string(newContents), "\r\n") {
|
||||
cmd = exec.Command("wl-copy", "-c")
|
||||
cmd.Run()
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
@@ -42,8 +42,8 @@ func ClipClear(oldContents string) {
|
||||
cmd := exec.Command("powershell.exe", "-c", "Get-Clipboard")
|
||||
newContents, _ := cmd.Output()
|
||||
|
||||
if oldContents == strings.TrimRight(string(newContents), "\n") {
|
||||
cmd := exec.Command("powershell.exe", "-c", "Set-Clipboard")
|
||||
if oldContents == strings.TrimRight(string(newContents), "\r\n") {
|
||||
cmd = exec.Command("powershell.exe", "-c", "Set-Clipboard")
|
||||
cmd.Run()
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
Reference in New Issue
Block a user