"template/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "f8c3dbe5b5ee342d97e4c71d684b85b00273c33d"
Commit 7ea90587 authored by Michael Yang's avatar Michael Yang
Browse files

only move cursor up if pos > 0

parent d6ecaa2c
......@@ -25,7 +25,7 @@ type Progress struct {
}
func NewProgress(w io.Writer) *Progress {
p := &Progress{pos: -1, w: w}
p := &Progress{w: w}
go p.start()
return p
}
......@@ -71,7 +71,10 @@ func (p *Progress) render() error {
p.mu.Lock()
defer p.mu.Unlock()
fmt.Fprintf(p.w, "\033[%dA", p.pos)
if p.pos > 0 {
fmt.Fprintf(p.w, "\033[%dA", p.pos)
}
for _, state := range p.states {
fmt.Fprintln(p.w, state.String())
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment