Codebase list golang-github-vbauerster-mpb / fb9c166 cwriter / writer_posix.go
fb9c166

Tree @fb9c166 (Download .tar.gz)

writer_posix.go @fb9c166raw · history · blame

// +build !windows

package cwriter

import (
	"fmt"
)

func (w *Writer) clearLines() {
	for i := 0; i < w.lineCount; i++ {
		fmt.Fprintf(w.out, "%c[%dA", ESC, 0) // move the cursor up
		fmt.Fprintf(w.out, "%c[2K\r", ESC)   // clear the line
	}
}