mr-karan / doggo

:dog: Command-line DNS Client for Humans. Written in Golang
https://doggo.mrkaran.dev/
GNU General Public License v3.0
3.07k stars 101 forks source link

fix: Correctly print colored text on Windows #46

Closed gaeulbyul closed 2 years ago

gaeulbyul commented 2 years ago

This commit will fix #40.

Replacing os.Stdout with color.Output will fix the problem on Windows's console.

Internally, color.Output is same as colorable.NewColorableStdout(), according to https://github.com/fatih/color/blob/acd5f3bb28257af7d3c4817ab6842e39bd0fcf34/color.go#L25-L27

see also: https://godocs.io/github.com/mattn/go-colorable#NewColorableStdout

mr-karan commented 2 years ago

Nice. Thanks @gaeulbyul