Skip to content

Commit

Permalink
Add a workaround for the rendering stuck issue (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
draftcode authored Aug 10, 2024
1 parent 0d3ef28 commit 1d3bfc6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/utils/colors/bgcolor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@ func SetupBackgroundColorTypeFromEnv() {
default:
// Otherwise, let lipgloss determine the background color based on the terminal.
}
// Workaround for lipgloss / MacOS Terminal.app issue.
//
// Inside HasDarkBackground() function, it'll eventually use termStatusReport(11) to get the
// current terminal background color.
//
// https://github.com/muesli/termenv/blob/98d742f6907a4622ef2e2f190123c86b6ec19b7b/termenv_unix.go#L95
//
// There are multiple locks in place until this call, but somehow if this is called in the
// Bubbletea loop, it'll deadlock / hang the program. So, we call it here before the loop
// starts, and once this is called, it'll be cached, so it'll never be called again.
lipgloss.HasDarkBackground()
}

0 comments on commit 1d3bfc6

Please sign in to comment.