Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/output: forcibly disable dark background detection in Buildkite #38694

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/output/capabilities.go
Expand Up @@ -30,6 +30,13 @@ type capabilities struct {
// that if an override is indicated in opts, no inference of the relevant capabilities
// is done at all.
func detectCapabilities(opts OutputOpts) (caps capabilities, err error) {
// Workaround: For some reason the dark background detection hangs indefinitely in
// Buildkite, so ForceDarkBackground being set is a required (Buildkite output is
// always against a dark background anyway, so for the user this should be fine)
if os.Getenv("BUILDKITE") == "true" {
opts.ForceDarkBackground = true
}

// Set atty
caps.Isatty = opts.ForceTTY
if !opts.ForceTTY {
Expand Down
4 changes: 4 additions & 0 deletions lib/output/output.go
Expand Up @@ -69,6 +69,10 @@ type OutputOpts struct {

// ForceDarkBackground ignores all terminal detection and sets whether the terminal
// background is dark to this value.
//
// Workaround: For some reason the dark background detection hangs indefinitely in
// Buildkite, so ForceDarkBackground being set is a required (Buildkite output is
// always against a dark background anyway, so for the user this should be fine)
ForceDarkBackground bool

Verbose bool
Expand Down