Skip to content

Commit

Permalink
add HideWindow attr
Browse files Browse the repository at this point in the history
  • Loading branch information
5rahim committed Aug 11, 2024
1 parent 6fa727b commit ed2b306
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/util/cmd_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ func NewCmd(arg string, args ...string) *exec.Cmd {
//cmd := exec.Command(cmdPrompt, cmdArgs...)
//cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd := exec.Command(arg, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: 0x08000000}
cmd.SysProcAttr = &syscall.SysProcAttr{
CreationFlags: 0x08000000,
HideWindow: true,
}
return cmd
}

Expand All @@ -26,6 +29,9 @@ func NewCmdCtx(ctx context.Context, arg string, args ...string) *exec.Cmd {
//cmd := exec.CommandContext(ctx, cmdPrompt, cmdArgs...)
//cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd := exec.CommandContext(ctx, arg, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: 0x08000000}
cmd.SysProcAttr = &syscall.SysProcAttr{
CreationFlags: 0x08000000,
HideWindow: true,
}
return cmd
}

0 comments on commit ed2b306

Please sign in to comment.