From cad3ab41aaa2cda8f33df64d22e6111f6bdcf45c Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 13 Dec 2017 13:42:07 +0100 Subject: [PATCH] hide console window when running v2ctl. fix #779 --- main/config_json.go | 1 + main/config_json_other.go | 9 +++++++++ main/config_json_windows.go | 11 +++++++++++ 3 files changed, 21 insertions(+) create mode 100644 main/config_json_other.go create mode 100644 main/config_json_windows.go diff --git a/main/config_json.go b/main/config_json.go index 6a826d7ac..0db6bc467 100644 --- a/main/config_json.go +++ b/main/config_json.go @@ -18,6 +18,7 @@ func jsonToProto(input io.Reader) (*core.Config, error) { cmd := exec.Command(v2ctl, "config") cmd.Stdin = input cmd.Stderr = os.Stderr + cmd.SysProcAttr = getSysProcAttr() stdoutReader, err := cmd.StdoutPipe() if err != nil { diff --git a/main/config_json_other.go b/main/config_json_other.go new file mode 100644 index 000000000..b1502710e --- /dev/null +++ b/main/config_json_other.go @@ -0,0 +1,9 @@ +// +build !windows + +package main + +import "syscall" + +func getSysProcAttr() *syscall.SysProcAttr { + return nil +} diff --git a/main/config_json_windows.go b/main/config_json_windows.go new file mode 100644 index 000000000..01c2b53ba --- /dev/null +++ b/main/config_json_windows.go @@ -0,0 +1,11 @@ +// +build windows + +package main + +import "syscall" + +func getSysProcAttr() *syscall.SysProcAttr { + return &syscall.SysProcAttr{ + HideWindow: true, + } +}