diff --git a/src/offline/UNIXcopy.go b/src/offline/UNIXcopy.go index 7087c0b..cd28b13 100644 --- a/src/offline/UNIXcopy.go +++ b/src/offline/UNIXcopy.go @@ -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) diff --git a/src/offline/WINcopy.go b/src/offline/WINcopy.go index b6e2592..3f6398c 100644 --- a/src/offline/WINcopy.go +++ b/src/offline/WINcopy.go @@ -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)