mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -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 := exec.Command(v2ctl, "config")
|
||||||
cmd.Stdin = input
|
cmd.Stdin = input
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
|
cmd.SysProcAttr = getSysProcAttr()
|
||||||
|
|
||||||
stdoutReader, err := cmd.StdoutPipe()
|
stdoutReader, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
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…
x
Reference in New Issue
Block a user