Skip to content

Commit

Permalink
fix: detect color profile
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed May 13, 2024
1 parent 1ef18e6 commit cf6db9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/charmbracelet/bubbletea
go 1.18

require (
github.com/charmbracelet/lipgloss v0.10.1-0.20240510203806-a6dc2ab509a8
github.com/charmbracelet/lipgloss v0.10.1-0.20240513205513-d059cfa7d6f0
github.com/charmbracelet/x/ansi v0.1.0
github.com/charmbracelet/x/input v0.1.0
github.com/charmbracelet/x/term v0.1.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/charmbracelet/lipgloss v0.10.1-0.20240510203806-a6dc2ab509a8 h1:aOfL0f8fhgqKe+iOIQYAIazSwTO4J0axB5ztPxw5JHY=
github.com/charmbracelet/lipgloss v0.10.1-0.20240510203806-a6dc2ab509a8/go.mod h1:axBjGt1mTZwwTM0kfcq8fPWFzNPj+ZAOjfLCr7JW9fk=
github.com/charmbracelet/x/ansi v0.1.0 h1:o4NbQQCoVgbLpD5RC1cI687baoLwrLZyCOTGlF0gne4=
github.com/charmbracelet/x/ansi v0.1.0/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/x/input v0.1.0 h1:TEsGSfZYQyOtp+STIjyBq6tpRaorH0qpwZUj8DavAhQ=
Expand Down
4 changes: 4 additions & 0 deletions tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"syscall"
"time"

"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/input"
"github.com/charmbracelet/x/term"
"github.com/lucasb-eyer/go-colorful"
Expand Down Expand Up @@ -448,6 +449,9 @@ func (p *Program) Run() (Model, error) {
p.errs = make(chan error)
p.finished = make(chan struct{}, 1)

// Detect color profile.
p.ctx.profile = lipgloss.DetectColorProfile(p.output, p.environ)

defer p.cancel()

switch p.inputType {
Expand Down

0 comments on commit cf6db9e

Please sign in to comment.