main
Raw Download raw file
 1package tea
 2
 3import (
 4	"github.com/charmbracelet/lipgloss"
 5)
 6
 7func init() {
 8	// XXX: This is a workaround to make assure that Lip Gloss and Termenv
 9	// query the terminal before any Bubble Tea Program runs and acquires the
10	// terminal. Without this, Programs that use Lip Gloss/Termenv might hang
11	// while waiting for a a [termenv.OSCTimeout] while querying the terminal
12	// for its background/foreground colors.
13	//
14	// This happens because Bubble Tea acquires the terminal before termenv
15	// reads any responses.
16	//
17	// Note that this will only affect programs running on the default IO i.e.
18	// [os.Stdout] and [os.Stdin].
19	//
20	// This workaround will be removed in v2.
21	_ = lipgloss.HasDarkBackground()
22}