Fix cmd pop-up on background clipclear on Windows

This commit is contained in:
2026-02-17 20:10:24 -05:00
parent 8da2648664
commit e9f49fb98a
3 changed files with 7 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
//go:build !ios && !android && !interactive
package clip
import (
"os"
"os/exec"
"github.com/rwinkhart/go-boilerplate/back"
"github.com/rwinkhart/libmutton/global"
)
// LaunchClearProcess launches the timed clipboard clearing process.
// For non-interactive CLI implementations, an entirely separate process is created for this purpose.
func LaunchClearProcess(copySubject []byte) {
cmd := exec.Command(os.Args[0], "clipclear")
cmd.SysProcAttr = global.GetSysProcAttr()
_ = back.WriteToStdin(cmd, copySubject, true)
_ = cmd.Start()
os.Exit(0) // use os.Exit directly since this version of this function is only meant for non-interactive CLI implementations
}