Remove now-redundant Linux/BSD-specific clip clear logic

This commit is contained in:
2025-12-26 20:48:33 -05:00
parent fdce036be6
commit 6004a94b77
5 changed files with 3 additions and 41 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func CopyString(clearClipboardAutomatically bool, copySubject string) error {
return errors.New("unable to copy to clipboard: " + err.Error()) return errors.New("unable to copy to clipboard: " + err.Error())
} }
if clearClipboardAutomatically { if clearClipboardAutomatically {
LaunchClipClearProcess(copySubject, sessionIsWayland) LaunchClipClearProcess(copySubject)
} }
return nil return nil
} }
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build (windows || wsl || (darwin && !ios) || (android && termux)) && !interactive //go:build !ios && (!android || termux) && !interactive
package clip package clip
@@ -1,22 +0,0 @@
//go:build !windows && !darwin && !android && !ios && !termux && !wsl && !interactive
package clip
import (
"os"
"os/exec"
"strconv"
"github.com/rwinkhart/go-boilerplate/back"
"github.com/rwinkhart/libmutton/global"
)
// LaunchClipClearProcess launches the timed clipboard clearing process.
// For non-interactive CLI implementations, an entirely separate process is created for this purpose.
func LaunchClipClearProcess(copySubject string, isWayland bool) {
cmd := exec.Command(os.Args[0], "clipclear", strconv.FormatBool(isWayland))
cmd.SysProcAttr = global.GetSysProcAttr()
_ = back.WriteToStdin(cmd, copySubject)
_ = cmd.Start()
os.Exit(0) // use os.Exit directly since this version of this function is only meant for non-interactive CLI implementations
}
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build (windows || wsl || (darwin && !ios) || (android && termux)) && interactive //go:build !ios && (!android || termux) && interactive
package clip package clip
@@ -1,16 +0,0 @@
//go:build !windows && !darwin && !android && !ios && !termux && !wsl && interactive
package clip
import (
"os"
"strconv"
)
// LaunchClipClearProcess launches the timed clipboard clearing process.
// For interactive GUI/TUI implementations, the clipboard clearing process is launched as a goroutine.
// copySubject can be omitted to clear the clipboard immediately and unconditionally.
func LaunchClipClearProcess(copySubject string, isWayland bool) {
os.Args = []string{os.Args[0], "", strconv.FormatBool(isWayland)}
go ClipClearProcess(copySubject)
}