detach server on windows

Related #106
This commit is contained in:
Gokcehan committed 2018-08-01 00:21:55 +03:00
1 parent d3f9a3588f
commit 0b8de7c77e
3 files changed
+13 -3

No files matched your search

+7
View File
@@ -7,6 +7,7 @@ import (
"os/user"
"path/filepath"
"strings"
"syscall"
)
var (
@@ -70,6 +71,12 @@ func init() {
gHistoryPath = filepath.Join(data, "lf", "history")
}
func detachedCommand(name string, arg ...string) *exec.Cmd {
cmd := exec.Command(name, arg...)
cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: 8}
return cmd
}
func pauseCommand() *exec.Cmd {
return exec.Command("cmd", "/c", "pause")
}