Skip to content

Commit

Permalink
Fix for non-interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Jun 25, 2024
1 parent 52b1908 commit 90c6f99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pkg/term/colorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ func NewTerm(stdout, stderr io.Writer) *Term {
}
t.hasDarkBg = t.stdout.HasDarkBackground()
if hasTermInEnv() {
fout, outIsFile := stdout.(interface{ Fd() uintptr })
ferr, errIsFile := stderr.(interface{ Fd() uintptr })
if outIsFile && errIsFile {
t.isTerminal = term.IsTerminal(int(fout.Fd())) && term.IsTerminal(int(ferr.Fd()))
if fout, ok := stdout.(interface{ Fd() uintptr }); ok {
t.isTerminal = term.IsTerminal(int(fout.Fd())) && term.IsTerminal(int(os.Stdin.Fd()))
}
}
t.outCanColor = doColor(t.stdout)
Expand Down

0 comments on commit 90c6f99

Please sign in to comment.