From f572e18144eaa0b8e4a4ff2cb675a8ce00430f4f Mon Sep 17 00:00:00 2001 From: Kayla Washburn-Love Date: Mon, 29 Jan 2024 13:56:43 -0700 Subject: [PATCH] fix: fix cliui prompt styling (#11899) --- cli/cliui/prompt.go | 4 ++-- cli/restart.go | 2 +- cli/restart_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/cliui/prompt.go b/cli/cliui/prompt.go index 2cc94b1fa3..1886ebf7ef 100644 --- a/cli/cliui/prompt.go +++ b/cli/cliui/prompt.go @@ -71,9 +71,9 @@ func Prompt(inv *clibase.Invocation, opts PromptOptions) (string, error) { } else { renderedNo = Bold(ConfirmNo) } - pretty.Fprintf(inv.Stdout, DefaultStyles.Placeholder, "(%s/%s) ", renderedYes, renderedNo) + _, _ = fmt.Fprintf(inv.Stdout, "(%s/%s) ", renderedYes, renderedNo) } else if opts.Default != "" { - _, _ = fmt.Fprint(inv.Stdout, pretty.Sprint(DefaultStyles.Placeholder, "("+opts.Default+") ")) + _, _ = fmt.Fprintf(inv.Stdout, "(%s) ", pretty.Sprint(DefaultStyles.Placeholder, opts.Default)) } interrupt := make(chan os.Signal, 1) diff --git a/cli/restart.go b/cli/restart.go index 351f96cf6b..c52fc6c9eb 100644 --- a/cli/restart.go +++ b/cli/restart.go @@ -41,7 +41,7 @@ func (r *RootCmd) restart() *clibase.Cmd { } _, err = cliui.Prompt(inv, cliui.PromptOptions{ - Text: "Confirm restart workspace?", + Text: "Restart workspace?", IsConfirm: true, }) if err != nil { diff --git a/cli/restart_test.go b/cli/restart_test.go index d38944caeb..56b7230797 100644 --- a/cli/restart_test.go +++ b/cli/restart_test.go @@ -84,7 +84,7 @@ func TestRestart(t *testing.T) { matches := []string{ ephemeralParameterDescription, ephemeralParameterValue, - "Confirm restart workspace?", "yes", + "Restart workspace?", "yes", "Stopping workspace", "", "Starting workspace", "", "workspace has been restarted", "", @@ -138,7 +138,7 @@ func TestRestart(t *testing.T) { }() matches := []string{ - "Confirm restart workspace?", "yes", + "Restart workspace?", "yes", "Stopping workspace", "", "Starting workspace", "", "workspace has been restarted", "",