Codebase list golang-github-muesli-goprogressbar / 5906e4d6-ef21-4cb3-b0ce-60af5190897c/main terminal.go
5906e4d6-ef21-4cb3-b0ce-60af5190897c/main

Tree @5906e4d6-ef21-4cb3-b0ce-60af5190897c/main (Download .tar.gz)

terminal.go @5906e4d6-ef21-4cb3-b0ce-60af5190897c/mainraw · history · blame

/*
 * goprogressbar
 *     Copyright (c) 2016-2017, Christian Muehlhaeuser <muesli@gmail.com>
 *
 *   For license see LICENSE
 */

package goprogressbar

import "fmt"

func clearCurrentLine() {
	fmt.Fprintf(Stdout, "\033[2K\r")
}

func moveCursorUp(lines uint) {
	fmt.Fprintf(Stdout, "\033[%dA", lines)
}

func moveCursorDown(lines uint) {
	fmt.Fprintf(Stdout, "\033[%dB", lines)
}