do not move/delete console output before printing anything

This commit is contained in:
Anand Babu (AB) Periasamy
2015-06-15 02:51:41 -07:00
parent 064148560c
commit 2b86af52d6
+7 -2
View File
@@ -126,9 +126,14 @@ func newCpBar() barSend {
cursorUp := fmt.Sprintf("%c[%dA", 27, 1)
eraseCurrentLine := fmt.Sprintf("%c[2K\r", 27)
cursorDown := fmt.Sprintf("%c[%dB", 27, 1)
firstTime := true
bar.Callback = func(s string) {
console.Print(cursorUp)
console.Print(eraseCurrentLine)
if !firstTime {
console.Print(cursorUp)
console.Print(eraseCurrentLine)
}
firstTime = false
console.Bar(barCaption)
console.Print(cursorDown)