@@ -21,16 +21,14 @@ import (
2121 "time"
2222
2323 "github.com/AlecAivazis/survey/v2"
24- "github.com/AlecAivazis/survey/v2/terminal"
24+ surveyterm "github.com/AlecAivazis/survey/v2/terminal"
2525 "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
2626 "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
2727 "github.com/azure/azure-dev/cli/azd/internal/tracing"
28- "github.com/azure/azure-dev/cli/azd/internal/tracing/resource"
2928 "github.com/azure/azure-dev/cli/azd/pkg/alpha"
3029 "github.com/azure/azure-dev/cli/azd/pkg/output"
3130 "github.com/azure/azure-dev/cli/azd/pkg/output/ux"
3231 tm "github.com/buger/goterm"
33- "github.com/mattn/go-isatty"
3432 "github.com/nathan-fiscaletti/consolesize-go"
3533 "github.com/theckman/yacspin"
3634 "go.uber.org/atomic"
@@ -600,7 +598,7 @@ func (c *AskerConsole) Prompt(ctx context.Context, options ConsoleOptions) (stri
600598
601599 result , err := c .promptClient .Prompt (ctx , opts )
602600 if errors .Is (err , promptCancelledErr ) {
603- return "" , terminal .InterruptErr
601+ return "" , surveyterm .InterruptErr
604602 } else if err != nil {
605603 return "" , err
606604 }
@@ -655,7 +653,7 @@ func (c *AskerConsole) Select(ctx context.Context, options ConsoleOptions) (int,
655653
656654 result , err := c .promptClient .Prompt (ctx , opts )
657655 if errors .Is (err , promptCancelledErr ) {
658- return - 1 , terminal .InterruptErr
656+ return - 1 , surveyterm .InterruptErr
659657 } else if err != nil {
660658 return - 1 , err
661659 }
@@ -735,7 +733,7 @@ func (c *AskerConsole) MultiSelect(ctx context.Context, options ConsoleOptions)
735733
736734 result , err := c .promptClient .Prompt (ctx , opts )
737735 if errors .Is (err , promptCancelledErr ) {
738- return nil , terminal .InterruptErr
736+ return nil , surveyterm .InterruptErr
739737 } else if err != nil {
740738 return nil , err
741739 }
@@ -802,7 +800,7 @@ func (c *AskerConsole) Confirm(ctx context.Context, options ConsoleOptions) (boo
802800
803801 result , err := c .promptClient .Prompt (ctx , opts )
804802 if errors .Is (err , promptCancelledErr ) {
805- return false , terminal .InterruptErr
803+ return false , surveyterm .InterruptErr
806804 } else if err != nil {
807805 return false , err
808806 }
@@ -1023,24 +1021,6 @@ func NewConsole(
10231021 return c
10241022}
10251023
1026- // IsTerminal returns true if the given file descriptors are attached to a terminal,
1027- // taking into account of environment variables that force TTY behavior.
1028- func IsTerminal (stdoutFd uintptr , stdinFd uintptr ) bool {
1029- // User override to force TTY behavior
1030- if forceTty , err := strconv .ParseBool (os .Getenv ("AZD_FORCE_TTY" )); err == nil {
1031- return forceTty
1032- }
1033-
1034- // By default, detect if we are running on CI and force no TTY mode if we are.
1035- // If this is affecting you locally while debugging on a CI machine,
1036- // use the override AZD_FORCE_TTY=true.
1037- if resource .IsRunningOnCI () {
1038- return false
1039- }
1040-
1041- return isatty .IsTerminal (stdoutFd ) && isatty .IsTerminal (stdinFd )
1042- }
1043-
10441024func GetStepResultFormat (result error ) SpinnerUxType {
10451025 formatResult := StepDone
10461026 if result != nil {
0 commit comments