mirror of
https://github.com/antonmedv/fx.git
synced 2024-09-11 18:27:10 +03:00
Set correct term profile
This commit is contained in:
parent
7faa3d2895
commit
c36c6ae17d
4
main.go
4
main.go
@ -22,7 +22,6 @@ import (
|
|||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/goccy/go-yaml"
|
"github.com/goccy/go-yaml"
|
||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
"github.com/muesli/termenv"
|
|
||||||
"github.com/sahilm/fuzzy"
|
"github.com/sahilm/fuzzy"
|
||||||
|
|
||||||
jsonpath "github.com/antonmedv/fx/path"
|
jsonpath "github.com/antonmedv/fx/path"
|
||||||
@ -162,8 +161,7 @@ func main() {
|
|||||||
search: newSearch(),
|
search: newSearch(),
|
||||||
}
|
}
|
||||||
|
|
||||||
output := termenv.NewOutput(os.Stderr)
|
lipgloss.SetColorProfile(termOutput.ColorProfile())
|
||||||
lipgloss.SetColorProfile(output.ColorProfile())
|
|
||||||
|
|
||||||
p := tea.NewProgram(m,
|
p := tea.NewProgram(m,
|
||||||
tea.WithAltScreen(),
|
tea.WithAltScreen(),
|
||||||
|
6
theme.go
6
theme.go
@ -50,6 +50,10 @@ func valueStyle(b []byte, selected, chunk bool) color {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
termOutput = termenv.NewOutput(os.Stderr)
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
themeNames = make([]string, 0, len(themes))
|
themeNames = make([]string, 0, len(themes))
|
||||||
for name := range themes {
|
for name := range themes {
|
||||||
@ -68,7 +72,7 @@ func init() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if termenv.ColorProfile() == termenv.Ascii {
|
if termOutput.ColorProfile() == termenv.Ascii {
|
||||||
currentTheme = themes["0"]
|
currentTheme = themes["0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user