Hide console on windows
The companion does no longer show a terminal window pop up
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// This is the windows CREATE_NO_WINDOW syscall.
|
||||
// We have no golang.org/x/sys dependency, so this will suffice
|
||||
const createNoWindow = 0x08000000
|
||||
|
||||
// Allows running commands without showing a terminal window on startup on windows
|
||||
func hideConsole(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
CreationFlags: createNoWindow,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user