diff --git a/task.go b/task.go index 38e7bf87..aca863b9 100644 --- a/task.go +++ b/task.go @@ -417,6 +417,12 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi stdOut := e.Output.WrapWriter(e.Stdout, t.Prefix) stdErr := e.Output.WrapWriter(e.Stderr, t.Prefix) + + if t.Interactive { + stdOut = output.Interleaved{}.WrapWriter(e.Stdout, t.Prefix) + stdErr = output.Interleaved{}.WrapWriter(e.Stderr, t.Prefix) + } + defer func() { if _, ok := stdOut.(*os.File); !ok { if closer, ok := stdOut.(io.Closer); ok { diff --git a/taskfile/task.go b/taskfile/task.go index 39a554fa..f9498eac 100644 --- a/taskfile/task.go +++ b/taskfile/task.go @@ -19,6 +19,7 @@ type Task struct { Vars *Vars Env *Vars Silent bool + Interactive bool Method string Prefix string IgnoreError bool @@ -59,6 +60,7 @@ func (t *Task) UnmarshalYAML(unmarshal func(interface{}) error) error { Vars *Vars Env *Vars Silent bool + Interactive bool Method string Prefix string IgnoreError bool `yaml:"ignore_error"` @@ -80,6 +82,7 @@ func (t *Task) UnmarshalYAML(unmarshal func(interface{}) error) error { t.Vars = task.Vars t.Env = task.Env t.Silent = task.Silent + t.Interactive = task.Interactive t.Method = task.Method t.Prefix = task.Prefix t.IgnoreError = task.IgnoreError diff --git a/variables.go b/variables.go index 0e7ff4c0..b0e0d339 100644 --- a/variables.go +++ b/variables.go @@ -56,6 +56,7 @@ func (e *Executor) compiledTask(call taskfile.Call, evaluateShVars bool) (*taskf Vars: nil, Env: nil, Silent: origTask.Silent, + Interactive: origTask.Interactive, Method: r.Replace(origTask.Method), Prefix: r.Replace(origTask.Prefix), IgnoreError: origTask.IgnoreError,