From 7ed0b8b4dae0151001343e61bd40399d2a52aada Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 18 Dec 2024 16:32:11 -0500 Subject: [PATCH] Installers should not default to non-interactive. --- cmd/state-installer/cmd.go | 2 +- cmd/state-remote-installer/main.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/state-installer/cmd.go b/cmd/state-installer/cmd.go index dc9f1deb72..bcec1db3e7 100644 --- a/cmd/state-installer/cmd.go +++ b/cmd/state-installer/cmd.go @@ -105,7 +105,7 @@ func main() { OutWriter: os.Stdout, ErrWriter: os.Stderr, Colored: true, - Interactive: false, + Interactive: !term.IsTerminal(int(os.Stdin.Fd())), }) if err != nil { multilog.Critical("Could not set up output handler: " + errs.JoinMessage(err)) diff --git a/cmd/state-remote-installer/main.go b/cmd/state-remote-installer/main.go index 7aa6a5653f..dd2f0126bd 100644 --- a/cmd/state-remote-installer/main.go +++ b/cmd/state-remote-installer/main.go @@ -29,6 +29,7 @@ import ( "github.com/ActiveState/cli/internal/runbits/errors" "github.com/ActiveState/cli/internal/runbits/panics" "github.com/ActiveState/cli/internal/updater" + "golang.org/x/term" ) type Params struct { @@ -90,7 +91,7 @@ func main() { OutWriter: os.Stdout, ErrWriter: os.Stderr, Colored: true, - Interactive: false, + Interactive: !term.IsTerminal(int(os.Stdin.Fd())), }) if err != nil { logging.Error("Could not set up output handler: " + errs.JoinMessage(err))