Commit 3bb5de5d authored by Amos Wenger's avatar Amos Wenger

Introduce console mode for Windows

parent 39ebfd0c
Pipeline #12405 passed with stage
in 31 seconds
......@@ -167,7 +167,7 @@ func (ar *attachRunner) Run() error {
case <-ar.params.Ctx.Done():
err := terminateProcess(ar.pid, 1)
if err != nil {
consumer.Warnf("Could not terminate PID (%d): %v", err)
consumer.Warnf("Could not terminate PID (%d): %v", ar.pid, err)
}
}
}()
......
......@@ -109,8 +109,13 @@ func (wr *fujiRunner) Run() error {
cmd.Stdout = params.Stdout
cmd.Stderr = params.Stderr
var creationFlags uint32 = syscallex.CREATE_SUSPENDED
if params.Console {
// note: this will disable std{in,out,err} redirection
creationFlags |= syscallex.CREATE_NEW_CONSOLE
}
cmd.SysProcAttr = &syscallex.SysProcAttr{
CreationFlags: syscallex.CREATE_SUSPENDED,
CreationFlags: creationFlags,
LogonFlags: syscallex.LOGON_WITH_PROFILE,
}
......
......@@ -16,6 +16,7 @@ type RunnerParams struct {
Ctx context.Context
Sandbox bool
Console bool
FullTargetPath string
......
......@@ -36,8 +36,13 @@ func (sr *simpleRunner) Run() error {
cmd.Stdout = params.Stdout
cmd.Stderr = params.Stderr
var creationFlags uint32 = syscallex.CREATE_SUSPENDED
if params.Console {
// note: this will disable std{in,out,err} redirection
creationFlags |= syscallex.CREATE_NEW_CONSOLE
}
cmd.SysProcAttr = &syscallex.SysProcAttr{
CreationFlags: syscallex.CREATE_SUSPENDED,
CreationFlags: creationFlags,
}
pg, err := NewProcessGroup(consumer, cmd, params.Ctx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment