mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-10-27 05:19:58 -04:00
Fix clipboard clearing on Windows
This commit is contained in:
1 parent
7a17df4aa3
commit
00e0a70ee6
2 files changed
+4
-4
No files matched your search
@@ -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