mirror of
https://github.com/xiaoqidun/wslkd.git
synced 2024-09-08 08:18:02 +08:00
fix(修复问题): 修复运行时弹出WSL命令行
This commit is contained in:
parent
2bcaa7d166
commit
476779ebce
6
wslkd.go
6
wslkd.go
@ -4,8 +4,10 @@ import (
|
||||
"flag"
|
||||
"github.com/xiaoqidun/gowsl"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -32,6 +34,10 @@ func exec(done *sync.WaitGroup, distro string) {
|
||||
return
|
||||
}
|
||||
cmd := gowsl.Command(distro, "/bin/bash")
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Printf("%v cmd run err: %v", distro, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user