fix(cli): speed up CLI over SSH (#7885)

By caching the terminal's color profile, we avoid myriad round trips during command execution.
This commit is contained in:
Ammar Bandukwala
2023-06-07 00:22:58 -05:00
committed by GitHub
parent 1288a83e42
commit 5eaf809851
46 changed files with 190 additions and 172 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ func (r *RootCmd) templateDelete() *clibase.Cmd {
// Confirm deletion of the template.
_, err = cliui.Prompt(inv, cliui.PromptOptions{
Text: fmt.Sprintf("Delete these templates: %s?", cliui.Styles.Code.Render(strings.Join(templateNames, ", "))),
Text: fmt.Sprintf("Delete these templates: %s?", cliui.DefaultStyles.Code.Render(strings.Join(templateNames, ", "))),
IsConfirm: true,
Default: cliui.ConfirmNo,
})
@@ -91,7 +91,7 @@ func (r *RootCmd) templateDelete() *clibase.Cmd {
return xerrors.Errorf("delete template %q: %w", template.Name, err)
}
_, _ = fmt.Fprintln(inv.Stdout, "Deleted template "+cliui.Styles.Code.Render(template.Name)+" at "+cliui.Styles.DateTimeStamp.Render(time.Now().Format(time.Stamp))+"!")
_, _ = fmt.Fprintln(inv.Stdout, "Deleted template "+cliui.DefaultStyles.Code.Render(template.Name)+" at "+cliui.DefaultStyles.DateTimeStamp.Render(time.Now().Format(time.Stamp))+"!")
}
return nil