This commit is contained in:
2026-05-16 00:18:06 -03:00
commit 92941e68a2
66 changed files with 10352 additions and 0 deletions

23
internal/oscmd/command.go Normal file
View File

@@ -0,0 +1,23 @@
package oscmd
import (
"context"
"os/exec"
)
// Command creates an exec.Cmd with platform-specific defaults that are safe for
// the GUI application. On Windows, the implementation hides child console
// windows so helpers like powershell.exe, netsh.exe, route.exe, xray.exe, and
// dnstt-client.exe do not flash a terminal window.
func Command(name string, args ...string) *exec.Cmd {
cmd := exec.Command(name, args...)
applyPlatformOptions(cmd)
return cmd
}
// CommandContext is the context-aware version of Command.
func CommandContext(ctx context.Context, name string, args ...string) *exec.Cmd {
cmd := exec.CommandContext(ctx, name, args...)
applyPlatformOptions(cmd)
return cmd
}