@@ -17,12 +17,22 @@ var (
1717 InterruptErr = ErrInterrupt // deprecated
1818)
1919
20+ // use the same colors as the previous "survey/v2".
21+ var (
22+ primaryStyle = pterm.Style {pterm .FgDefault }
23+ secondaryStyle = pterm.Style {pterm .FgCyan }
24+ )
25+
2026// Confirm is a regular text input that accept yes/no answers.
2127func Confirm (message string , defaultParam bool ) (bool , error ) {
2228 var ans bool
2329 var err error
30+ interactiveConfirm := pterm .DefaultInteractiveConfirm
31+ // override the default theme colors (cyan/magenta)
32+ interactiveConfirm .TextStyle = & primaryStyle
33+ interactiveConfirm .SuffixStyle = & secondaryStyle
2434 interrupted := false
25- prompt := pterm . DefaultInteractiveConfirm .
35+ prompt := interactiveConfirm .
2636 WithDefaultText (message ).
2737 WithDefaultValue (defaultParam ).
2838 WithOnInterruptFunc (func () {
@@ -43,8 +53,12 @@ func Select(message string, options []string) (int, error) {
4353 var ans int
4454 var sel string
4555 var err error
56+ interactiveSelect := pterm .DefaultInteractiveSelect
57+ // override the default theme colors (cyan/magenta)
58+ interactiveSelect .TextStyle = & primaryStyle
59+ interactiveSelect .SelectorStyle = & secondaryStyle
4660 interrupted := false
47- prompt := pterm . DefaultInteractiveSelect .
61+ prompt := interactiveSelect .
4862 WithDefaultText (message ).
4963 WithOptions (options ).
5064 WithOnInterruptFunc (func () {
0 commit comments