From 818d512504576988e481dd2de5ff4d23f711fbcb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Feb 2024 08:55:06 +0000
Subject: [PATCH] Go: Bump github.com/AlecAivazis/survey/v2 from 2.3.5 to 2.3.7
 (#7202)

Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.3.5 to 2.3.7.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.3.5...v2.3.7)

---
updated-dependencies:
- dependency-name: github.com/AlecAivazis/survey/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
 go.mod                                        |  2 +-
 go.sum                                        |  5 +-
 .../AlecAivazis/survey/v2/README.md           | 33 ++++++++
 .../AlecAivazis/survey/v2/confirm.go          |  1 +
 .../AlecAivazis/survey/v2/core/template.go    | 35 +++++---
 .../AlecAivazis/survey/v2/core/write.go       | 14 ++--
 .../github.com/AlecAivazis/survey/v2/input.go | 15 +---
 .../AlecAivazis/survey/v2/multiselect.go      | 20 ++++-
 .../AlecAivazis/survey/v2/password.go         |  6 +-
 .../AlecAivazis/survey/v2/renderer.go         |  5 +-
 .../AlecAivazis/survey/v2/select.go           | 84 ++++++-------------
 .../AlecAivazis/survey/v2/survey.go           | 52 +++++++++---
 .../survey/v2/terminal/display_posix.go       |  1 +
 .../AlecAivazis/survey/v2/terminal/error.go   |  1 +
 .../AlecAivazis/survey/v2/terminal/output.go  |  1 +
 .../survey/v2/terminal/runereader.go          | 31 +++++++
 .../survey/v2/terminal/runereader_bsd.go      |  1 +
 .../survey/v2/terminal/runereader_linux.go    |  1 +
 .../survey/v2/terminal/runereader_posix.go    |  1 +
 .../survey/v2/terminal/runereader_ppc64le.go  |  1 +
 .../AlecAivazis/survey/v2/transform.go        |  5 +-
 .../AlecAivazis/survey/v2/validate.go         |  1 +
 vendor/modules.txt                            |  2 +-
 23 files changed, 206 insertions(+), 112 deletions(-)

diff --git a/go.mod b/go.mod
index 7b556bf6e82..db1002de1cf 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.19
 require (
 	github.com/ActiveState/termtest v0.7.2
 	github.com/ActiveState/termtest/expect v0.7.0
-	github.com/AlecAivazis/survey/v2 v2.3.5
+	github.com/AlecAivazis/survey/v2 v2.3.7
 	github.com/Xuanwo/go-locale v1.1.0
 	github.com/blang/semver v3.5.1+incompatible
 	github.com/devfile/alizer v1.3.1
diff --git a/go.sum b/go.sum
index 0785e6ee1c9..8286ce16406 100644
--- a/go.sum
+++ b/go.sum
@@ -58,8 +58,8 @@ github.com/ActiveState/termtest/xpty v0.6.0/go.mod h1:MmTm/62Ajq+D92emHq8LOu9Q+2
 github.com/ActiveState/vt10x v1.3.1 h1:7qi8BGXUEBghzBxfXSY0J77etO+L95PZQlwD7ay2mn0=
 github.com/ActiveState/vt10x v1.3.1/go.mod h1:8wJKd36c9NmCfGyPyOJmkvyIMvbUPfHkfdS8zZlK19s=
 github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74=
-github.com/AlecAivazis/survey/v2 v2.3.5 h1:A8cYupsAZkjaUmhtTYv3sSqc7LO5mp1XDfqe5E/9wRQ=
-github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI=
+github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
+github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
 github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
 github.com/Azure/azure-sdk-for-go v56.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@@ -1660,7 +1660,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
 golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
diff --git a/vendor/github.com/AlecAivazis/survey/v2/README.md b/vendor/github.com/AlecAivazis/survey/v2/README.md
index ac2c6fc7f98..ba75b329f41 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/README.md
+++ b/vendor/github.com/AlecAivazis/survey/v2/README.md
@@ -357,6 +357,39 @@ All of the prompts have a `Help` field which can be defined to provide more info
 }
 ```
 
+## Removing the "Select All" and "Select None" options
+
+By default, users can select all of the multi-select options using the right arrow key. To prevent users from being able to do this (and remove the `<right> to all` message from the prompt), use the option `WithRemoveSelectAll`:
+
+```golang
+import (
+    "github.com/AlecAivazis/survey/v2"
+)
+
+number := ""
+prompt := &survey.Input{
+    Message: "This question has the select all option removed",
+}
+
+survey.AskOne(prompt, &number, survey.WithRemoveSelectAll())
+```
+
+Also by default, users can use the left arrow key to unselect all of the options. To prevent users from being able to do this (and remove the `<left> to none` message from the prompt), use the option `WithRemoveSelectNone`:
+
+```golang
+import (
+    "github.com/AlecAivazis/survey/v2"
+)
+
+number := ""
+prompt := &survey.Input{
+    Message: "This question has the select all option removed",
+}
+
+survey.AskOne(prompt, &number, survey.WithRemoveSelectNone())
+```
+
+
 ### Changing the input rune
 
 In some situations, `?` is a perfectly valid response. To handle this, you can change the rune that survey
diff --git a/vendor/github.com/AlecAivazis/survey/v2/confirm.go b/vendor/github.com/AlecAivazis/survey/v2/confirm.go
index 9662e6cdb7b..1c23fb4d12a 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/confirm.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/confirm.go
@@ -90,6 +90,7 @@ func (c *Confirm) getBool(showHelp bool, config *PromptConfig) (bool, error) {
 			continue
 		default:
 			// we didnt get a valid answer, so print error and prompt again
+			//lint:ignore ST1005 it should be fine for this error message to have punctuation
 			if err := c.Error(config, fmt.Errorf("%q is not a valid answer, please try again.", val)); err != nil {
 				return c.Default, err
 			}
diff --git a/vendor/github.com/AlecAivazis/survey/v2/core/template.go b/vendor/github.com/AlecAivazis/survey/v2/core/template.go
index 6b3d20cdc74..02da879dcbb 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/core/template.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/core/template.go
@@ -2,6 +2,7 @@ package core
 
 import (
 	"bytes"
+	"os"
 	"sync"
 	"text/template"
 
@@ -23,11 +24,22 @@ var TemplateFuncsNoColor = map[string]interface{}{
 	},
 }
 
-//RunTemplate returns two formatted strings given a template and
-//the data it requires. The first string returned is generated for
-//user-facing output and may or may not contain ANSI escape codes
-//for colored output. The second string does not contain escape codes
-//and can be used by the renderer for layout purposes.
+// envColorDisabled returns if output colors are forbid by environment variables
+func envColorDisabled() bool {
+	return os.Getenv("NO_COLOR") != "" || os.Getenv("CLICOLOR") == "0"
+}
+
+// envColorForced returns if output colors are forced from environment variables
+func envColorForced() bool {
+	val, ok := os.LookupEnv("CLICOLOR_FORCE")
+	return ok && val != "0"
+}
+
+// RunTemplate returns two formatted strings given a template and
+// the data it requires. The first string returned is generated for
+// user-facing output and may or may not contain ANSI escape codes
+// for colored output. The second string does not contain escape codes
+// and can be used by the renderer for layout purposes.
 func RunTemplate(tmpl string, data interface{}) (string, string, error) {
 	tPair, err := GetTemplatePair(tmpl)
 	if err != nil {
@@ -52,11 +64,11 @@ var (
 	memoMutex = &sync.RWMutex{}
 )
 
-//GetTemplatePair returns a pair of compiled templates where the
-//first template is generated for user-facing output and the
-//second is generated for use by the renderer. The second
-//template does not contain any color escape codes, whereas
-//the first template may or may not depending on DisableColor.
+// GetTemplatePair returns a pair of compiled templates where the
+// first template is generated for user-facing output and the
+// second is generated for use by the renderer. The second
+// template does not contain any color escape codes, whereas
+// the first template may or may not depending on DisableColor.
 func GetTemplatePair(tmpl string) ([2]*template.Template, error) {
 	memoMutex.RLock()
 	if t, ok := memoizedGetTemplate[tmpl]; ok {
@@ -74,7 +86,8 @@ func GetTemplatePair(tmpl string) ([2]*template.Template, error) {
 
 	templatePair[1] = templateNoColor
 
-	if DisableColor {
+	envColorHide := envColorDisabled() && !envColorForced()
+	if DisableColor || envColorHide {
 		templatePair[0] = templatePair[1]
 	} else {
 		templateWithColor, err := template.New("prompt").Funcs(TemplateFuncsWithColor).Parse(tmpl)
diff --git a/vendor/github.com/AlecAivazis/survey/v2/core/write.go b/vendor/github.com/AlecAivazis/survey/v2/core/write.go
index 94a886c3615..2225e3b2231 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/core/write.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/core/write.go
@@ -142,12 +142,12 @@ func (err errFieldNotMatch) Is(target error) bool { // implements the dynamic er
 // It returns the Question.Name that couldn't be matched with a destination field.
 //
 // Usage:
-// err := survey.Ask(qs, &v);
-// if err != nil {
-// 	if name, ok := core.IsFieldNotMatch(err); ok {
-//		[...name is the not matched question name]
-// 	}
-// }
+//
+//	if err := survey.Ask(qs, &v); err != nil {
+//		if name, ok := core.IsFieldNotMatch(err); ok {
+//			// name is the question name that did not match a field
+//		}
+//	}
 func IsFieldNotMatch(err error) (string, bool) {
 	if err != nil {
 		if v, ok := err.(errFieldNotMatch); ok {
@@ -301,6 +301,7 @@ func copy(t reflect.Value, v reflect.Value) (err error) {
 		case reflect.Float64:
 			castVal, casterr = strconv.ParseFloat(vString, 64)
 		default:
+			//lint:ignore ST1005 allow this error message to be capitalized
 			return fmt.Errorf("Unable to convert from string to type %s", t.Kind())
 		}
 
@@ -335,6 +336,7 @@ func copy(t reflect.Value, v reflect.Value) (err error) {
 		}
 
 		// we're copying an option answer to an incorrect type
+		//lint:ignore ST1005 allow this error message to be capitalized
 		return fmt.Errorf("Unable to convert from OptionAnswer to type %s", t.Kind())
 	}
 
diff --git a/vendor/github.com/AlecAivazis/survey/v2/input.go b/vendor/github.com/AlecAivazis/survey/v2/input.go
index dbc7c08cd15..047476386fe 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/input.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/input.go
@@ -127,14 +127,14 @@ func (i *Input) onRune(config *PromptConfig) terminal.OnRuneFn {
 		)
 
 		if err == nil {
-			err = readLineAgain
+			err = errReadLineAgain
 		}
 
 		return []rune(i.typedAnswer), true, err
 	})
 }
 
-var readLineAgain = errors.New("read line again")
+var errReadLineAgain = errors.New("read line again")
 
 func (i *Input) Prompt(config *PromptConfig) (interface{}, error) {
 	// render the template
@@ -170,7 +170,7 @@ func (i *Input) Prompt(config *PromptConfig) (interface{}, error) {
 		}
 
 		line, err = rr.ReadLineWithDefault(0, line, i.onRune(config))
-		if err == readLineAgain {
+		if err == errReadLineAgain {
 			continue
 		}
 
@@ -207,20 +207,13 @@ func (i *Input) Prompt(config *PromptConfig) (interface{}, error) {
 }
 
 func (i *Input) Cleanup(config *PromptConfig, val interface{}) error {
-	// use the default answer when cleaning up the prompt if necessary
-	ans := i.answer
-	if ans == "" && i.Default != "" {
-		ans = i.Default
-	}
-
-	// render the cleanup
 	return i.Render(
 		InputQuestionTemplate,
 		InputTemplateData{
 			Input:      *i,
 			ShowAnswer: true,
 			Config:     config,
-			Answer:     ans,
+			Answer:     val.(string),
 		},
 	)
 }
diff --git a/vendor/github.com/AlecAivazis/survey/v2/multiselect.go b/vendor/github.com/AlecAivazis/survey/v2/multiselect.go
index 3251ea1cccb..396169f3e8a 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/multiselect.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/multiselect.go
@@ -29,6 +29,7 @@ type MultiSelect struct {
 	VimMode       bool
 	FilterMessage string
 	Filter        func(filter string, value string, index int) bool
+	Description   func(value string, index int) string
 	filter        string
 	selectedIndex int
 	checked       map[int]bool
@@ -43,6 +44,7 @@ type MultiSelectTemplateData struct {
 	Checked       map[int]bool
 	SelectedIndex int
 	ShowHelp      bool
+	Description   func(value string, index int) string
 	PageEntries   []core.OptionAnswer
 	Config        *PromptConfig
 
@@ -59,19 +61,26 @@ func (m MultiSelectTemplateData) IterateOption(ix int, opt core.OptionAnswer) in
 	return copy
 }
 
+func (m MultiSelectTemplateData) GetDescription(opt core.OptionAnswer) string {
+	if m.Description == nil {
+		return ""
+	}
+	return m.Description(opt.Value, opt.Index)
+}
+
 var MultiSelectQuestionTemplate = `
 {{- define "option"}}
     {{- if eq .SelectedIndex .CurrentIndex }}{{color .Config.Icons.SelectFocus.Format }}{{ .Config.Icons.SelectFocus.Text }}{{color "reset"}}{{else}} {{end}}
     {{- if index .Checked .CurrentOpt.Index }}{{color .Config.Icons.MarkedOption.Format }} {{ .Config.Icons.MarkedOption.Text }} {{else}}{{color .Config.Icons.UnmarkedOption.Format }} {{ .Config.Icons.UnmarkedOption.Text }} {{end}}
     {{- color "reset"}}
-    {{- " "}}{{- .CurrentOpt.Value}}
+    {{- " "}}{{- .CurrentOpt.Value}}{{ if ne ($.GetDescription .CurrentOpt) "" }} - {{color "cyan"}}{{ $.GetDescription .CurrentOpt }}{{color "reset"}}{{end}}
 {{end}}
 {{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color "reset"}}{{"\n"}}{{end}}
 {{- color .Config.Icons.Question.Format }}{{ .Config.Icons.Question.Text }} {{color "reset"}}
 {{- color "default+hb"}}{{ .Message }}{{ .FilterMessage }}{{color "reset"}}
 {{- if .ShowAnswer}}{{color "cyan"}} {{.Answer}}{{color "reset"}}{{"\n"}}
 {{- else }}
-	{{- "  "}}{{- color "cyan"}}[Use arrows to move, space to select, <right> to all, <left> to none, type to filter{{- if and .Help (not .ShowHelp)}}, {{ .Config.HelpInput }} for more help{{end}}]{{color "reset"}}
+	{{- "  "}}{{- color "cyan"}}[Use arrows to move, space to select,{{- if not .Config.RemoveSelectAll }} <right> to all,{{end}}{{- if not .Config.RemoveSelectNone }} <left> to none,{{end}} type to filter{{- if and .Help (not .ShowHelp)}}, {{ .Config.HelpInput }} for more help{{end}}]{{color "reset"}}
   {{- "\n"}}
   {{- range $ix, $option := .PageEntries}}
     {{- template "option" $.IterateOption $ix $option}}
@@ -134,14 +143,14 @@ func (m *MultiSelect) OnChange(key rune, config *PromptConfig) {
 	} else if key >= terminal.KeySpace {
 		m.filter += string(key)
 		m.VimMode = false
-	} else if key == terminal.KeyArrowRight {
+	} else if !config.RemoveSelectAll && key == terminal.KeyArrowRight {
 		for _, v := range options {
 			m.checked[v.Index] = true
 		}
 		if !config.KeepFilter {
 			m.filter = ""
 		}
-	} else if key == terminal.KeyArrowLeft {
+	} else if !config.RemoveSelectNone && key == terminal.KeyArrowLeft {
 		for _, v := range options {
 			m.checked[v.Index] = false
 		}
@@ -179,6 +188,7 @@ func (m *MultiSelect) OnChange(key rune, config *PromptConfig) {
 		SelectedIndex: idx,
 		Checked:       m.checked,
 		ShowHelp:      m.showingHelp,
+		Description:   m.Description,
 		PageEntries:   opts,
 		Config:        config,
 	}
@@ -272,6 +282,7 @@ func (m *MultiSelect) Prompt(config *PromptConfig) (interface{}, error) {
 	tmplData := MultiSelectTemplateData{
 		MultiSelect:   *m,
 		SelectedIndex: idx,
+		Description:   m.Description,
 		Checked:       m.checked,
 		PageEntries:   opts,
 		Config:        config,
@@ -342,6 +353,7 @@ func (m *MultiSelect) Cleanup(config *PromptConfig, val interface{}) error {
 			Checked:       m.checked,
 			Answer:        answer,
 			ShowAnswer:    true,
+			Description:   m.Description,
 			Config:        config,
 		},
 	)
diff --git a/vendor/github.com/AlecAivazis/survey/v2/password.go b/vendor/github.com/AlecAivazis/survey/v2/password.go
index 877102c69ea..96a2ae89fe6 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/password.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/password.go
@@ -60,7 +60,7 @@ func (p *Password) Prompt(config *PromptConfig) (interface{}, error) {
 
 	// no help msg?  Just return any response
 	if p.Help == "" {
-		line, err := rr.ReadLine('*')
+		line, err := rr.ReadLine(config.HideCharacter)
 		return string(line), err
 	}
 
@@ -69,7 +69,7 @@ func (p *Password) Prompt(config *PromptConfig) (interface{}, error) {
 	var line []rune
 	// process answers looking for help prompt answer
 	for {
-		line, err = rr.ReadLine('*')
+		line, err = rr.ReadLine(config.HideCharacter)
 		if err != nil {
 			return string(line), err
 		}
@@ -96,7 +96,7 @@ func (p *Password) Prompt(config *PromptConfig) (interface{}, error) {
 	}
 
 	lineStr := string(line)
-	p.AppendRenderedText(strings.Repeat("*", len(lineStr)))
+	p.AppendRenderedText(strings.Repeat(string(config.HideCharacter), len(lineStr)))
 	return lineStr, err
 }
 
diff --git a/vendor/github.com/AlecAivazis/survey/v2/renderer.go b/vendor/github.com/AlecAivazis/survey/v2/renderer.go
index a89b061e05f..a16207de072 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/renderer.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/renderer.go
@@ -3,8 +3,6 @@ package survey
 import (
 	"bytes"
 	"fmt"
-	"unicode/utf8"
-
 	"github.com/AlecAivazis/survey/v2/core"
 	"github.com/AlecAivazis/survey/v2/terminal"
 	"golang.org/x/term"
@@ -180,7 +178,8 @@ func (r *Renderer) countLines(buf bytes.Buffer) int {
 			delim = len(bufBytes) // no new line found, read rest of text
 		}
 
-		if lineWidth := utf8.RuneCount(bufBytes[curr:delim]); lineWidth > w {
+		str := string(bufBytes[curr:delim])
+		if lineWidth := terminal.StringWidth(str); lineWidth > w {
 			// account for word wrapping
 			count += lineWidth / w
 			if (lineWidth % w) == 0 {
diff --git a/vendor/github.com/AlecAivazis/survey/v2/select.go b/vendor/github.com/AlecAivazis/survey/v2/select.go
index 494f15d1b9d..1210122f406 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/select.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/select.go
@@ -2,6 +2,7 @@ package survey
 
 import (
 	"errors"
+	"fmt"
 
 	"github.com/AlecAivazis/survey/v2/core"
 	"github.com/AlecAivazis/survey/v2/terminal"
@@ -31,7 +32,6 @@ type Select struct {
 	Description   func(value string, index int) string
 	filter        string
 	selectedIndex int
-	useDefault    bool
 	showingHelp   bool
 }
 
@@ -103,8 +103,6 @@ func (s *Select) OnChange(key rune, config *PromptConfig) bool {
 
 		// if the user pressed the up arrow or 'k' to emulate vim
 	} else if (key == terminal.KeyArrowUp || (s.VimMode && key == 'k')) && len(options) > 0 {
-		s.useDefault = false
-
 		// if we are at the top of the list
 		if s.selectedIndex == 0 {
 			// start from the button
@@ -116,7 +114,6 @@ func (s *Select) OnChange(key rune, config *PromptConfig) bool {
 
 		// if the user pressed down or 'j' to emulate vim
 	} else if (key == terminal.KeyTab || key == terminal.KeyArrowDown || (s.VimMode && key == 'j')) && len(options) > 0 {
-		s.useDefault = false
 		// if we are at the bottom of the list
 		if s.selectedIndex == len(options)-1 {
 			// start from the top
@@ -147,8 +144,6 @@ func (s *Select) OnChange(key rune, config *PromptConfig) bool {
 		s.filter += string(key)
 		// make sure vim mode is disabled
 		s.VimMode = false
-		// make sure that we use the current value in the filtered list
-		s.useDefault = false
 	}
 
 	s.FilterMessage = ""
@@ -207,7 +202,6 @@ func (s *Select) filterOptions(config *PromptConfig) []core.OptionAnswer {
 		filter = config.Filter
 	}
 
-	//
 	for i, opt := range s.Options {
 		// i the filter says to include the option
 		if filter(s.filter, opt, i) {
@@ -229,23 +223,29 @@ func (s *Select) Prompt(config *PromptConfig) (interface{}, error) {
 		return "", errors.New("please provide options to select from")
 	}
 
-	// start off with the first option selected
-	sel := 0
-	// if there is a default
-	if s.Default != "" {
-		// find the choice
-		for i, opt := range s.Options {
-			// if the option corresponds to the default
-			if opt == s.Default {
-				// we found our initial value
-				sel = i
-				// stop looking
-				break
+	s.selectedIndex = 0
+	if s.Default != nil {
+		switch defaultValue := s.Default.(type) {
+		case string:
+			var found bool
+			for i, opt := range s.Options {
+				if opt == defaultValue {
+					s.selectedIndex = i
+					found = true
+				}
+			}
+			if !found {
+				return "", fmt.Errorf("default value %q not found in options", defaultValue)
+			}
+		case int:
+			if defaultValue >= len(s.Options) {
+				return "", fmt.Errorf("default index %d exceeds the number of options", defaultValue)
 			}
+			s.selectedIndex = defaultValue
+		default:
+			return "", errors.New("default value of select must be an int or string")
 		}
 	}
-	// save the selected index
-	s.selectedIndex = sel
 
 	// figure out the page size
 	pageSize := s.PageSize
@@ -256,7 +256,7 @@ func (s *Select) Prompt(config *PromptConfig) (interface{}, error) {
 	}
 
 	// figure out the options and index to render
-	opts, idx := paginate(pageSize, core.OptionAnswerList(s.Options), sel)
+	opts, idx := paginate(pageSize, core.OptionAnswerList(s.Options), s.selectedIndex)
 
 	cursor := s.NewCursor()
 	cursor.Save()          // for proper cursor placement during selection
@@ -279,9 +279,6 @@ func (s *Select) Prompt(config *PromptConfig) (interface{}, error) {
 		return "", err
 	}
 
-	// by default, use the default value
-	s.useDefault = true
-
 	rr := s.NewRuneReader()
 	_ = rr.SetTermMode()
 	defer func() {
@@ -304,45 +301,16 @@ func (s *Select) Prompt(config *PromptConfig) (interface{}, error) {
 			break
 		}
 	}
+
 	options := s.filterOptions(config)
 	s.filter = ""
 	s.FilterMessage = ""
 
-	// the index to report
-	var val string
-	// if we are supposed to use the default value
-	if s.useDefault || s.selectedIndex >= len(options) {
-		// if there is a default value
-		if s.Default != nil {
-			// if the default is a string
-			if defaultString, ok := s.Default.(string); ok {
-				// use the default value
-				val = defaultString
-				// the default value could also be an interpret which is interpretted as the index
-			} else if defaultIndex, ok := s.Default.(int); ok {
-				val = s.Options[defaultIndex]
-			} else {
-				return val, errors.New("default value of select must be an int or string")
-			}
-		} else if len(options) > 0 {
-			// there is no default value so use the first
-			val = options[0].Value
-		}
-		// otherwise the selected index points to the value
-	} else if s.selectedIndex < len(options) {
-		// the
-		val = options[s.selectedIndex].Value
-	}
-
-	// now that we have the value lets go hunt down the right index to return
-	idx = -1
-	for i, optionValue := range s.Options {
-		if optionValue == val {
-			idx = i
-		}
+	if s.selectedIndex < len(options) {
+		return options[s.selectedIndex], err
 	}
 
-	return core.OptionAnswer{Value: val, Index: idx}, err
+	return options[0], err
 }
 
 func (s *Select) Cleanup(config *PromptConfig, val interface{}) error {
diff --git a/vendor/github.com/AlecAivazis/survey/v2/survey.go b/vendor/github.com/AlecAivazis/survey/v2/survey.go
index 95136ebe37e..aad73bbe709 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/survey.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/survey.go
@@ -56,8 +56,11 @@ func defaultAskOptions() *AskOptions {
 				// include this option if it matches
 				return strings.Contains(strings.ToLower(value), filter)
 			},
-			KeepFilter: false,
-			ShowCursor: false,
+			KeepFilter:       false,
+			ShowCursor:       false,
+			RemoveSelectAll:  false,
+			RemoveSelectNone: false,
+			HideCharacter:    '*',
 		},
 	}
 }
@@ -111,13 +114,16 @@ type Question struct {
 
 // PromptConfig holds the global configuration for a prompt
 type PromptConfig struct {
-	PageSize     int
-	Icons        IconSet
-	HelpInput    string
-	SuggestInput string
-	Filter       func(filter string, option string, index int) bool
-	KeepFilter   bool
-	ShowCursor   bool
+	PageSize         int
+	Icons            IconSet
+	HelpInput        string
+	SuggestInput     string
+	Filter           func(filter string, option string, index int) bool
+	KeepFilter       bool
+	ShowCursor       bool
+	RemoveSelectAll  bool
+	RemoveSelectNone bool
+	HideCharacter    rune
 }
 
 // Prompt is the primary interface for the objects that can take user input
@@ -175,6 +181,22 @@ func WithKeepFilter(KeepFilter bool) AskOpt {
 	}
 }
 
+// WithRemoveSelectAll remove the select all option in Multiselect
+func WithRemoveSelectAll() AskOpt {
+	return func(options *AskOptions) error {
+		options.PromptConfig.RemoveSelectAll = true
+		return nil
+	}
+}
+
+// WithRemoveSelectNone remove the select none/unselect all in Multiselect
+func WithRemoveSelectNone() AskOpt {
+	return func(options *AskOptions) error {
+		options.PromptConfig.RemoveSelectNone = true
+		return nil
+	}
+}
+
 // WithValidator specifies a validator to use while prompting the user
 func WithValidator(v Validator) AskOpt {
 	return func(options *AskOptions) error {
@@ -234,6 +256,17 @@ func WithShowCursor(ShowCursor bool) AskOpt {
 	}
 }
 
+// WithHideCharacter sets the default character shown instead of the password for password inputs
+func WithHideCharacter(char rune) AskOpt {
+	return func(options *AskOptions) error {
+		// set the hide character
+		options.PromptConfig.HideCharacter = char
+
+		// nothing went wrong
+		return nil
+	}
+}
+
 /*
 AskOne performs the prompt for a single prompt and asks for validation if required.
 Response types should be something that can be casted from the response type designated
@@ -245,7 +278,6 @@ in the documentation. For example:
 	}
 
 	survey.AskOne(prompt, &name)
-
 */
 func AskOne(p Prompt, response interface{}, opts ...AskOpt) error {
 	err := Ask([]*Question{{Prompt: p}}, response, opts...)
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/display_posix.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/display_posix.go
index 4660808751b..fbd1b7947b8 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/display_posix.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/display_posix.go
@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package terminal
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/error.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/error.go
index 710c361406e..55eb66540c3 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/error.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/error.go
@@ -5,5 +5,6 @@ import (
 )
 
 var (
+	//lint:ignore ST1012 keeping old name for backwards compatibility
 	InterruptErr = errors.New("interrupt")
 )
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/output.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/output.go
index 6fe11c089fa..29102420c2d 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/output.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/output.go
@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package terminal
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader.go
index e881d7532cd..998e415e57a 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader.go
@@ -377,10 +377,41 @@ func (rr *RuneReader) ReadLineWithDefault(mask rune, d []rune, onRunes ...OnRune
 	}
 }
 
+// runeWidth returns the number of columns spanned by a rune when printed to the terminal
 func runeWidth(r rune) int {
 	switch width.LookupRune(r).Kind() {
 	case width.EastAsianWide, width.EastAsianFullwidth:
 		return 2
 	}
+
+	if !unicode.IsPrint(r) {
+		return 0
+	}
 	return 1
 }
+
+// isAnsiMarker returns if a rune denotes the start of an ANSI sequence
+func isAnsiMarker(r rune) bool {
+	return r == '\x1B'
+}
+
+// isAnsiTerminator returns if a rune denotes the end of an ANSI sequence
+func isAnsiTerminator(r rune) bool {
+	return (r >= 0x40 && r <= 0x5a) || (r == 0x5e) || (r >= 0x60 && r <= 0x7e)
+}
+
+// StringWidth returns the visible width of a string when printed to the terminal
+func StringWidth(str string) int {
+	w := 0
+	ansi := false
+
+	for _, r := range str {
+		// increase width only when outside of ANSI escape sequences
+		if ansi || isAnsiMarker(r) {
+			ansi = !isAnsiTerminator(r)
+		} else {
+			w += runeWidth(r)
+		}
+	}
+	return w
+}
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_bsd.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_bsd.go
index 6ea340923ad..57f1014257c 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_bsd.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_bsd.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
 // +build darwin dragonfly freebsd netbsd openbsd
 
 package terminal
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_linux.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_linux.go
index 6dd60ea6977..dc7ec670ce6 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_linux.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_linux.go
@@ -2,6 +2,7 @@
 // Copyright 2013 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
+//go:build linux && !ppc64le
 // +build linux,!ppc64le
 
 package terminal
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_posix.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_posix.go
index 3b8460497a3..563a08115a4 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_posix.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_posix.go
@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 // The terminal mode manipulation code is derived heavily from:
diff --git a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_ppc64le.go b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_ppc64le.go
index ae4eb097376..450f796c6a2 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_ppc64le.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/terminal/runereader_ppc64le.go
@@ -1,3 +1,4 @@
+//go:build ppc64le && linux
 // +build ppc64le,linux
 
 package terminal
diff --git a/vendor/github.com/AlecAivazis/survey/v2/transform.go b/vendor/github.com/AlecAivazis/survey/v2/transform.go
index 58d5193b03f..a78ada3925c 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/transform.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/transform.go
@@ -3,6 +3,9 @@ package survey
 import (
 	"reflect"
 	"strings"
+
+	"golang.org/x/text/cases"
+	"golang.org/x/text/language"
 )
 
 // TransformString returns a `Transformer` based on the "f"
@@ -62,7 +65,7 @@ func ToLower(ans interface{}) interface{} {
 // return a nil value, meaning that the above answer
 // will not be affected by this call at all.
 func Title(ans interface{}) interface{} {
-	transformer := TransformString(strings.Title)
+	transformer := TransformString(cases.Title(language.English).String)
 	return transformer(ans)
 }
 
diff --git a/vendor/github.com/AlecAivazis/survey/v2/validate.go b/vendor/github.com/AlecAivazis/survey/v2/validate.go
index f196148433e..7f03b23ac71 100644
--- a/vendor/github.com/AlecAivazis/survey/v2/validate.go
+++ b/vendor/github.com/AlecAivazis/survey/v2/validate.go
@@ -15,6 +15,7 @@ func Required(val interface{}) error {
 
 	// if the value passed in is the zero value of the appropriate type
 	if isZero(value) && value.Kind() != reflect.Bool {
+		//lint:ignore ST1005 this error message should render as capitalized
 		return errors.New("Value is required")
 	}
 	return nil
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 1afe00fac11..e1ab4ea5e93 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -19,7 +19,7 @@ github.com/ActiveState/termtest/xpty
 # github.com/ActiveState/vt10x v1.3.1
 ## explicit; go 1.13
 github.com/ActiveState/vt10x
-# github.com/AlecAivazis/survey/v2 v2.3.5
+# github.com/AlecAivazis/survey/v2 v2.3.7
 ## explicit; go 1.13
 github.com/AlecAivazis/survey/v2
 github.com/AlecAivazis/survey/v2/core