Skip to content

Commit

Permalink
cli: Unbreak colors in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Sep 12, 2021
1 parent 75cf46f commit 2874bc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ func (o *standardOS) Stdin() fs.File {
}

type standardOsOutput struct {
rl *readline.Instance
os *standardOS
}

func (o standardOsOutput) Write(p []byte) (n int, err error) {
if o.rl != nil {
return o.rl.Write(p)
if o.os.rl != nil {
return o.os.rl.Write(p)
}
return os.Stdout.Write(p)
}
Expand All @@ -94,7 +94,7 @@ func (o standardOsOutput) IsTerminal() bool {
return readline.IsTerminal(int(os.Stdout.Fd()))
}

func (o *standardOS) Stdout() interp.Output { return standardOsOutput{rl: o.rl} }
func (o *standardOS) Stdout() interp.Output { return standardOsOutput{os: o} }

func (o *standardOS) Stderr() io.Writer { return os.Stderr }

Expand Down

0 comments on commit 2874bc7

Please sign in to comment.