🐛 Program should still halt even with spinner

This commit is contained in:
Dan Jones 2024-10-29 11:28:47 -05:00
commit fd68ffbbf8
3 changed files with 31 additions and 2 deletions

View file

@ -94,7 +94,12 @@ func (s *spin) Err() error {
}
func Spin(ctx context.Context, message string) Spinner {
p := tea.NewProgram(newModel(message), tea.WithContext(ctx))
p := tea.NewProgram(
newModel(message),
tea.WithContext(ctx),
tea.WithoutSignalHandler(),
tea.WithInput(nil),
)
s := &spin{p: p, finished: make(chan struct{}, 1)}
go func() {
_, err := s.p.Run()