mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-03 16:00:49 +00:00
Restore CmdLine parameter when running commands using cmd.exe
This commit is contained in:
parent
f39ae0e7c1
commit
159a37fa37
|
@ -57,10 +57,20 @@ func (x *Executor) ExecCommand(command string, setpgid bool) *exec.Cmd {
|
||||||
}
|
}
|
||||||
x.shellPath.Store(shell)
|
x.shellPath.Store(shell)
|
||||||
}
|
}
|
||||||
cmd := exec.Command(shell, append(x.args, command)...)
|
var cmd *exec.Cmd
|
||||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
if strings.Contains(shell, "cmd") {
|
||||||
HideWindow: false,
|
cmd = exec.Command(shell)
|
||||||
CreationFlags: 0,
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||||
|
HideWindow: false,
|
||||||
|
CmdLine: fmt.Sprintf(`%s "%s"`, strings.Join(x.args, " "), command),
|
||||||
|
CreationFlags: 0,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cmd = exec.Command(shell, append(x.args, command)...)
|
||||||
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||||
|
HideWindow: false,
|
||||||
|
CreationFlags: 0,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user