From e292bbf0494520b2b1a6bebb0f4fa9c6510524b5 Mon Sep 17 00:00:00 2001 From: Miguel Ibars <43891734+mikybars@users.noreply.github.com> Date: Fri, 11 Apr 2025 06:46:49 -0700 Subject: [PATCH] fix: detect timeout error and apply default option (#888) --- confirm/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confirm/command.go b/confirm/command.go index abbfad9..e1f30bc 100644 --- a/confirm/command.go +++ b/confirm/command.go @@ -1,6 +1,7 @@ package confirm import ( + "context" "fmt" "os" @@ -46,7 +47,7 @@ func (o Options) Run() error { tea.WithOutput(os.Stderr), tea.WithContext(ctx), ).Run() - if err != nil { + if err != nil && ctx.Err() != context.DeadlineExceeded { return fmt.Errorf("unable to confirm: %w", err) } m = tm.(model)