From 6004a94b7718a97bdc847ea99a8a39761c7b0075 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 26 Dec 2025 20:48:33 -0500 Subject: [PATCH] Remove now-redundant Linux/BSD-specific clip clear logic --- clip/copy_UNIX.go | 2 +- clip/launchClipClearProcessCLI_GENERIC.go | 2 +- clip/launchClipClearProcessCLI_LINUX_BSD.go | 22 --------------------- clip/launchClipClearProcessGUI_GENERIC.go | 2 +- clip/launchClipClearProcessGUI_LINUX_BSD.go | 16 --------------- 5 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 clip/launchClipClearProcessCLI_LINUX_BSD.go delete mode 100644 clip/launchClipClearProcessGUI_LINUX_BSD.go diff --git a/clip/copy_UNIX.go b/clip/copy_UNIX.go index f8e4f9b..d550236 100644 --- a/clip/copy_UNIX.go +++ b/clip/copy_UNIX.go @@ -30,7 +30,7 @@ func CopyString(clearClipboardAutomatically bool, copySubject string) error { return errors.New("unable to copy to clipboard: " + err.Error()) } if clearClipboardAutomatically { - LaunchClipClearProcess(copySubject, sessionIsWayland) + LaunchClipClearProcess(copySubject) } return nil } diff --git a/clip/launchClipClearProcessCLI_GENERIC.go b/clip/launchClipClearProcessCLI_GENERIC.go index aa6b312..cdb8d8c 100644 --- a/clip/launchClipClearProcessCLI_GENERIC.go +++ b/clip/launchClipClearProcessCLI_GENERIC.go @@ -1,4 +1,4 @@ -//go:build (windows || wsl || (darwin && !ios) || (android && termux)) && !interactive +//go:build !ios && (!android || termux) && !interactive package clip diff --git a/clip/launchClipClearProcessCLI_LINUX_BSD.go b/clip/launchClipClearProcessCLI_LINUX_BSD.go deleted file mode 100644 index c910cfe..0000000 --- a/clip/launchClipClearProcessCLI_LINUX_BSD.go +++ /dev/null @@ -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 -} diff --git a/clip/launchClipClearProcessGUI_GENERIC.go b/clip/launchClipClearProcessGUI_GENERIC.go index b802e43..ada7022 100644 --- a/clip/launchClipClearProcessGUI_GENERIC.go +++ b/clip/launchClipClearProcessGUI_GENERIC.go @@ -1,4 +1,4 @@ -//go:build (windows || wsl || (darwin && !ios) || (android && termux)) && interactive +//go:build !ios && (!android || termux) && interactive package clip diff --git a/clip/launchClipClearProcessGUI_LINUX_BSD.go b/clip/launchClipClearProcessGUI_LINUX_BSD.go deleted file mode 100644 index 83f400d..0000000 --- a/clip/launchClipClearProcessGUI_LINUX_BSD.go +++ /dev/null @@ -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) -}