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

Tree @2d20fed (Download .tar.gz)

writer_posix.go @2d20fedraw · 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
	}
}