Fix compilation for Mac/Termux/Windows

This commit is contained in:
2025-12-27 00:25:53 -05:00
parent d8d761b0ca
commit b707d67113
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ func CopyString(clearClipboardAutomatically bool, copySubject string) error {
} }
// getClipCommands returns the commands for pasting and clearing the clipboard contents. // getClipCommands returns the commands for pasting and clearing the clipboard contents.
func getClipCommands() (*exec.Cmd, *exec.Cmd) { func getClipCommands() (*exec.Cmd, *exec.Cmd, error) {
cmdClear := exec.Command("pbcopy") cmdClear := exec.Command("pbcopy")
_ = back.WriteToStdin(cmdClear, "") _ = back.WriteToStdin(cmdClear, "")
return exec.Command("pbpaste"), cmdClear return exec.Command("pbpaste"), cmdClear, nil
} }
+2 -2
View File
@@ -24,8 +24,8 @@ func CopyString(clearClipboardAutomatically bool, copySubject string) error {
} }
// getClipCommands returns the commands for pasting and clearing the clipboard contents. // getClipCommands returns the commands for pasting and clearing the clipboard contents.
func getClipCommands() (*exec.Cmd, *exec.Cmd) { func getClipCommands() (*exec.Cmd, *exec.Cmd, error) {
cmdClear := exec.Command("termux-clipboard-set") cmdClear := exec.Command("termux-clipboard-set")
_ = back.WriteToStdin(cmdClear, "") _ = back.WriteToStdin(cmdClear, "")
return exec.Command("termux-clipboard-get"), cmdClear return exec.Command("termux-clipboard-get"), cmdClear, nil
} }
+2 -2
View File
@@ -23,6 +23,6 @@ func CopyString(clearClipboardAutomatically bool, copySubject string) error {
} }
// getClipCommands returns the commands for pasting and clearing the clipboard contents. // getClipCommands returns the commands for pasting and clearing the clipboard contents.
func getClipCommands() (*exec.Cmd, *exec.Cmd) { func getClipCommands() (*exec.Cmd, *exec.Cmd, error) {
return exec.Command("powershell.exe", "-c", "Get-Clipboard"), exec.Command("powershell.exe", "-c", "Set-Clipboard") return exec.Command("powershell.exe", "-c", "Get-Clipboard"), exec.Command("powershell.exe", "-c", "Set-Clipboard"), nil
} }