Skip to content

Commit

Permalink
fix(output): set default tty before querying the terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas authored and muesli committed Mar 9, 2023
1 parent 094b520 commit ada8a8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

var (
// output is the default global output.
output = NewOutput(nil)
output = NewOutput(os.Stdout)
)

// File represents a file descriptor.
Expand Down Expand Up @@ -73,15 +73,15 @@ func NewOutput(tty io.Writer, opts ...OutputOption) *Output {
bgColor: NoColor{},
}

if o.tty == nil {
o.tty = os.Stdout
}
for _, opt := range opts {
opt(o)
}
if o.Profile < 0 {
o.Profile = o.EnvColorProfile()
}
if o.tty == nil {
o.tty = os.Stdout
}

return o
}
Expand Down

0 comments on commit ada8a8c

Please sign in to comment.