File: writer_posix.go

package info (click to toggle)
golang-github-gosuri-uilive 0.0~git20170323.ac356e6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 244 kB
  • sloc: makefile: 4
file content (14 lines) | stat: -rw-r--r-- 246 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// +build !windows

package uilive

import (
	"fmt"
)

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