-
-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Description
Describe the Feature
How does the team feel about adding a spinner to the atmos validate stacks operation? It can be difficult to tell whether the command is hanging or actively running in the background. Here’s the current output:
√ . [infra] (HOST) workspace ⨠ atmos validate stacksThen:
√ . [infra] (HOST) workspace ⨠ atmos validate stacks
all stacks validated successfullyExpected Behavior
- Adds a spinner to the validation operation:
√ . [infra] (HOST) workspace ⨠ atmos validate stacks
⣯ Validating Atmos stacks...Use Case
- It can be difficult to tell whether the command is hanging or actively running in the background
Describe Ideal Solution
- Add spinner to the operation:
// Initialize spinner
s := spinner.New()
s.Style = theme.Styles.Link
var opts []tea.ProgramOption
if !CheckTTYSupport() {
// set tea.WithInput(nil) workaround tea program not run on not TTY mod issue
opts = []tea.ProgramOption{tea.WithoutRenderer(), tea.WithInput(nil)}
u.LogTrace("No TTY detected. Falling back to basic output. This can happen when no terminal is attached or when commands are pipelined.")
fmt.Println(message)
}
p := tea.NewProgram(modelSpinner{
spinner: s,
message: message,
}, opts...)
spinnerDone := make(chan struct{})
go func() {
if _, err := p.Run(); err != nil {
// If there's any error running the spinner, just print the message
fmt.Println(message)
u.LogError(fmt.Errorf("failed to run spinner: %w", err))
}
close(spinnerDone)
}()
Alternatives Considered
No response
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels