1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

hide console window when running v2ctl. fix #779

This commit is contained in:
Darien Raymond 2017-12-13 13:42:07 +01:00
parent ba26fd8361
commit cad3ab41aa
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
3 changed files with 21 additions and 0 deletions

View File

@ -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 {

View File

@ -0,0 +1,9 @@
// +build !windows
package main
import "syscall"
func getSysProcAttr() *syscall.SysProcAttr {
return nil
}

View File

@ -0,0 +1,11 @@
// +build windows
package main
import "syscall"
func getSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{
HideWindow: true,
}
}