Skip to content

Commit

Permalink
Merge pull request #349 from overmindtech/bug--
Browse files Browse the repository at this point in the history
Fix "random" ANSI spew/UI hang
  • Loading branch information
DavidS-ovm authored Jun 3, 2024
2 parents 86af0ec + d84f8c6 commit 5d499d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cmd/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/glamour/ansi"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)

type LogoPalette struct {
Expand Down Expand Up @@ -175,7 +174,7 @@ func MarkdownStyle() ansi.StyleConfig {
var labelMuted string
var labelTitle string

if termenv.HasDarkBackground() {
if lipgloss.HasDarkBackground() {
bgBase = ColorPalette.BgBase.Dark
bgMain = ColorPalette.BgMain.Dark
labelBase = ColorPalette.LabelBase.Dark
Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package main

import "github.com/overmindtech/cli/cmd"
import (
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
"github.com/overmindtech/cli/cmd"
)

func main() {
// work around lipgloss/termenv integration bug.
// See https://github.com/charmbracelet/lipgloss/issues/73#issuecomment-1144921037
lipgloss.SetHasDarkBackground(termenv.HasDarkBackground())

cmd.Execute()
}

0 comments on commit 5d499d4

Please sign in to comment.