X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=status.go;h=994e431d57739f1848c386b92003338cea2f0e98;hb=a6510ac6225a3a93df9d27dc316a3c1c0fcde426;hp=f203b7411202d86c3ae52d13ab49db9115f9bc29;hpb=66de71f560cd772e7ef9e9cf1182ce67e495b1ec;p=goredo.git diff --git a/status.go b/status.go index f203b74..994e431 100644 --- a/status.go +++ b/status.go @@ -21,7 +21,6 @@ import ( "flag" "fmt" "os" - "strings" ) const ( @@ -65,7 +64,6 @@ func statusInit() { waiting := 0 done := 0 var out string - outLenPrev := 0 buf := make([]byte, 1) var n int for { @@ -86,25 +84,19 @@ func statusInit() { } if NoColor { out = fmt.Sprintf( - "\rrun: %d wait: %d done: %d\r", + "\rrun: %d wait: %d done: %d", running, waiting, done, ) } else { out = fmt.Sprintf( - "\rrun: %s%d%s wait: %s%d%s done: %s%d%s\r", + "\rrun: %s%d%s wait: %s%d%s done: %s%d%s", CRedo, running, CReset, CWait, waiting, CReset, CJS, done, CReset, ) } - if len(out) < outLenPrev { - outLenPrev = len(out) - out += strings.Repeat(" ", outLenPrev-len(out)) - } else { - outLenPrev = len(out) - } LogMutex.Lock() - os.Stderr.WriteString(out) + os.Stderr.WriteString(fillUpToTermSize(out, "\r")) LogMutex.Unlock() } }()