mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
hide console window when running v2ctl. fix #779
This commit is contained in:
parent
ba26fd8361
commit
cad3ab41aa
@ -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 {
|
||||
|
9
main/config_json_other.go
Normal file
9
main/config_json_other.go
Normal file
@ -0,0 +1,9 @@
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
import "syscall"
|
||||
|
||||
func getSysProcAttr() *syscall.SysProcAttr {
|
||||
return nil
|
||||
}
|
11
main/config_json_windows.go
Normal file
11
main/config_json_windows.go
Normal file
@ -0,0 +1,11 @@
|
||||
// +build windows
|
||||
|
||||
package main
|
||||
|
||||
import "syscall"
|
||||
|
||||
func getSysProcAttr() *syscall.SysProcAttr {
|
||||
return &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user