diff --git a/cmd/state/internal/cmdtree/cmdtree.go b/cmd/state/internal/cmdtree/cmdtree.go index 2a26337532..494d686fd3 100644 --- a/cmd/state/internal/cmdtree/cmdtree.go +++ b/cmd/state/internal/cmdtree/cmdtree.go @@ -278,14 +278,6 @@ func newStateCommand(globals *globalOptions, prime *primer.Values) *captain.Comm Persist: true, Value: &globals.Output, }, - { - /* This option is only used for the vscode extension: It prevents the integrated terminal to close immediately after an error occurs, such that the user can read the message */ - Name: "confirm-exit-on-error", // Name and Shorthand should be kept in sync with cmd/state/output.go - Description: "prompts the user to press enter before exiting, when an error occurs", - Persist: true, - Hidden: true, // No need to add this to help messages - Value: &opts.ConfirmExit, - }, { Name: "non-interactive", // Name and Shorthand should be kept in sync with cmd/state/output.go Description: locale.T("flag_state_non_interactive_description"), diff --git a/cmd/state/main.go b/cmd/state/main.go index 0ee1d8d14e..7b0a876276 100644 --- a/cmd/state/main.go +++ b/cmd/state/main.go @@ -1,12 +1,9 @@ package main import ( - "bufio" "context" - "errors" "fmt" "os" - "os/exec" "runtime/debug" "strings" "time" @@ -108,17 +105,6 @@ func main() { if err != nil { out.Error(err) } - - // If a state tool error occurs in a VSCode integrated terminal, we want - // to pause and give time to the user to read the error message. - // But not, if we exit, because the last command in the activated sub-shell failed. - var eerr *exec.ExitError - isExitError := errors.As(err, &eerr) - if !isExitError && outFlags.ConfirmExit { - out.Print(locale.T("confirm_exit_on_error_prompt")) - br := bufio.NewReader(os.Stdin) - br.ReadLine() - } } } diff --git a/cmd/state/main_test.go b/cmd/state/main_test.go index d383b3bbae..8afa765158 100644 --- a/cmd/state/main_test.go +++ b/cmd/state/main_test.go @@ -51,7 +51,6 @@ func (suite *MainTestSuite) TestParseOutputFlags() { suite.Equal(outputFlags{"json", false, false, false}, parseOutputFlags([]string{"state", "foo", "-o", "json"})) suite.Equal(outputFlags{"editor", false, false, false}, parseOutputFlags([]string{"state", "foo", "--output", "editor"})) suite.Equal(outputFlags{"", true, false, false}, parseOutputFlags([]string{"state", "foo", "--mono"})) - suite.Equal(outputFlags{"", false, true, false}, parseOutputFlags([]string{"state", "foo", "--confirm-exit-on-error"})) suite.Equal(outputFlags{"", false, false, true}, parseOutputFlags([]string{"state", "foo", "--non-interactive"})) suite.Equal(outputFlags{"", false, false, true}, parseOutputFlags([]string{"state", "foo", "-n"})) } diff --git a/cmd/state/output.go b/cmd/state/output.go index edce18f21d..74db4e896c 100644 --- a/cmd/state/output.go +++ b/cmd/state/output.go @@ -19,7 +19,6 @@ type outputFlags struct { // These should be kept in sync with cmd/state/internal/cmdtree (output flag) Output string `short:"o" long:"output"` Mono bool `long:"mono"` - ConfirmExit bool `long:"confirm-exit-on-error"` NonInteractive bool `short:"n" long:"non-interactive"` } diff --git a/internal/locale/locales/en-us.yaml b/internal/locale/locales/en-us.yaml index 0f56c30565..f629b724c2 100644 --- a/internal/locale/locales/en-us.yaml +++ b/internal/locale/locales/en-us.yaml @@ -1569,8 +1569,6 @@ deploy_usable_path: Please ensure '[NOTICE]{{.V0}}[/RESET]' exists and is on your PATH. script_watcher_watch_file: other: "Watching file changes at: [NOTICE]{{.V0}}[/RESET]" -confirm_exit_on_error_prompt: - other: Press enter to continue... tutorial_newproject_intro: other: | The State Tool lets you create and maintain a set of virtual environments (eg., one per project), allowing you to