Skip to content

Commit f572e18

Browse files
authored
fix: fix cliui prompt styling (#11899)
1 parent 207328c commit f572e18

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cli/cliui/prompt.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ func Prompt(inv *clibase.Invocation, opts PromptOptions) (string, error) {
7171
} else {
7272
renderedNo = Bold(ConfirmNo)
7373
}
74-
pretty.Fprintf(inv.Stdout, DefaultStyles.Placeholder, "(%s/%s) ", renderedYes, renderedNo)
74+
_, _ = fmt.Fprintf(inv.Stdout, "(%s/%s) ", renderedYes, renderedNo)
7575
} else if opts.Default != "" {
76-
_, _ = fmt.Fprint(inv.Stdout, pretty.Sprint(DefaultStyles.Placeholder, "("+opts.Default+") "))
76+
_, _ = fmt.Fprintf(inv.Stdout, "(%s) ", pretty.Sprint(DefaultStyles.Placeholder, opts.Default))
7777
}
7878
interrupt := make(chan os.Signal, 1)
7979

cli/restart.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (r *RootCmd) restart() *clibase.Cmd {
4141
}
4242

4343
_, err = cliui.Prompt(inv, cliui.PromptOptions{
44-
Text: "Confirm restart workspace?",
44+
Text: "Restart workspace?",
4545
IsConfirm: true,
4646
})
4747
if err != nil {

cli/restart_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestRestart(t *testing.T) {
8484

8585
matches := []string{
8686
ephemeralParameterDescription, ephemeralParameterValue,
87-
"Confirm restart workspace?", "yes",
87+
"Restart workspace?", "yes",
8888
"Stopping workspace", "",
8989
"Starting workspace", "",
9090
"workspace has been restarted", "",
@@ -138,7 +138,7 @@ func TestRestart(t *testing.T) {
138138
}()
139139

140140
matches := []string{
141-
"Confirm restart workspace?", "yes",
141+
"Restart workspace?", "yes",
142142
"Stopping workspace", "",
143143
"Starting workspace", "",
144144
"workspace has been restarted", "",

0 commit comments

Comments
 (0)