diff --git a/tea.go b/tea.go index 34fb883e59..1b0f287a1c 100644 --- a/tea.go +++ b/tea.go @@ -581,10 +581,12 @@ func (p *Program) Start() error { // If the program hasn't started yet this will be a blocking operation. // If the program has already been terminated this will be a no-op, so it's safe // to send messages after the program has exited. -func (p *Program) Send(msg Msg) { +func (p *Program) Send(msg Msg) bool { select { case <-p.ctx.Done(): + return false case p.msgs <- msg: + return true } }