mirror of
https://github.com/minio/minio.git
synced 2025-11-29 05:19:03 -05:00
Fix Windows console printing (#8805)
Print to console which does translation and not directly to stdout. Fixes #8804
This commit is contained in:
committed by
Harshavardhana
parent
3320878dfb
commit
627fdfeab7
@@ -19,6 +19,7 @@ package logger
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
"github.com/minio/minio/pkg/color"
|
||||
)
|
||||
@@ -32,18 +33,27 @@ func ansiEscape(format string, args ...interface{}) {
|
||||
}
|
||||
|
||||
func ansiMoveRight(n int) {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
if color.IsTerminal() {
|
||||
ansiEscape("[%dC", n)
|
||||
}
|
||||
}
|
||||
|
||||
func ansiSaveAttributes() {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
if color.IsTerminal() {
|
||||
ansiEscape("7")
|
||||
}
|
||||
}
|
||||
|
||||
func ansiRestoreAttributes() {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
if color.IsTerminal() {
|
||||
ansiEscape("8")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user