Skip to content

Commit

Permalink
fix: send color profile message after setting it on the renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Dec 22, 2024
1 parent f54c049 commit 317c49f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,6 @@ func (p *Program) Run() (Model, error) {
if err := p.initTerminal(); err != nil {
return p.initialModel, err
}

go p.Send(ColorProfileMsg{p.profile})
if p.renderer == nil {
// If no renderer is set use the ferocious one.
p.renderer = newScreenRenderer(p.output, p.getenv("TERM"))
Expand All @@ -759,8 +757,9 @@ func (p *Program) Run() (Model, error) {
p.profile = colorprofile.Detect(p.output.Writer(), p.environ)
}

// Set the color profile on the renderer.
// Set the color profile on the renderer and send it to the program.
p.renderer.setColorProfile(p.profile)
go p.Send(ColorProfileMsg{p.profile})

// Get the initial window size.
resizeMsg := WindowSizeMsg{Width: p.width, Height: p.height}
Expand Down

0 comments on commit 317c49f

Please sign in to comment.