Skip to content

Commit

Permalink
fix: deadlock condition on model init panic
Browse files Browse the repository at this point in the history
  • Loading branch information
eolso authored and muesli committed Apr 17, 2024
1 parent d61e697 commit 1c6e74d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tea.go
Expand Up @@ -508,6 +508,9 @@ func (p *Program) Run() (Model, error) {
p.renderer.enableMouseSGRMode()
}

// Start the renderer.
p.renderer.start()

// Initialize the program.
model := p.initialModel
if initCmd := model.Init(); initCmd != nil {
Expand All @@ -524,9 +527,6 @@ func (p *Program) Run() (Model, error) {
}()
}

// Start the renderer.
p.renderer.start()

// Render the initial view.
p.renderer.write(model.View())

Expand Down

0 comments on commit 1c6e74d

Please sign in to comment.