Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: hide desktop backend console on windows

Lyric 3f946af8 0a656adf

+54
+1
desktop/wails/host.go
··· 86 86 args := buildConsoleServeArgs(launcher.argsHead, h.cfg, listenAddr) 87 87 _, _ = fmt.Fprintf(os.Stderr, "desktop host launching backend: %s %s\n", launcher.execPath, strings.Join(args, " ")) 88 88 cmd := exec.Command(launcher.execPath, args...) 89 + applyDesktopChildProcessAttrs(cmd) 89 90 cmd.Env = buildDesktopChildEnv(os.Environ()) 90 91 cmd.Stdout = os.Stdout 91 92 cmd.Stderr = os.Stderr
+9
desktop/wails/process_attrs_nonwindows.go
··· 1 + //go:build wailsdesktop && !windows 2 + 3 + package main 4 + 5 + import "os/exec" 6 + 7 + func applyDesktopChildProcessAttrs(cmd *exec.Cmd) { 8 + _ = cmd 9 + }
+20
desktop/wails/process_attrs_windows.go
··· 1 + //go:build wailsdesktop && windows 2 + 3 + package main 4 + 5 + import ( 6 + "os/exec" 7 + "syscall" 8 + ) 9 + 10 + const desktopCreateNoWindow = 0x08000000 11 + 12 + func applyDesktopChildProcessAttrs(cmd *exec.Cmd) { 13 + if cmd == nil { 14 + return 15 + } 16 + cmd.SysProcAttr = &syscall.SysProcAttr{ 17 + HideWindow: true, 18 + CreationFlags: desktopCreateNoWindow, 19 + } 20 + }
+24
desktop/wails/process_attrs_windows_test.go
··· 1 + //go:build wailsdesktop && windows 2 + 3 + package main 4 + 5 + import ( 6 + "os/exec" 7 + "testing" 8 + ) 9 + 10 + func TestApplyDesktopChildProcessAttrs(t *testing.T) { 11 + cmd := exec.Command("cmd", "/c", "echo", "ok") 12 + 13 + applyDesktopChildProcessAttrs(cmd) 14 + 15 + if cmd.SysProcAttr == nil { 16 + t.Fatalf("SysProcAttr = nil") 17 + } 18 + if !cmd.SysProcAttr.HideWindow { 19 + t.Fatalf("HideWindow = false, want true") 20 + } 21 + if cmd.SysProcAttr.CreationFlags&desktopCreateNoWindow == 0 { 22 + t.Fatalf("CreationFlags = %#x, want %#x bit set", cmd.SysProcAttr.CreationFlags, desktopCreateNoWindow) 23 + } 24 + }