From 2874bc7995b6158875fc3e691fe5e06777e09b3c Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Thu, 26 Aug 2021 17:47:09 +0200 Subject: [PATCH] cli: Unbreak colors in windows --- pkg/cli/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index b7d7253c4..40f5314a7 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -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) } @@ -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 }