Unverified Commit f9c7ead1 authored by Jeremy Schlatter's avatar Jeremy Schlatter
Browse files

cmd: eliminate flickering with synchronized output

parent 5930aaeb
...@@ -83,11 +83,14 @@ func (p *Progress) render() { ...@@ -83,11 +83,14 @@ func (p *Progress) render() {
p.mu.Lock() p.mu.Lock()
defer p.mu.Unlock() defer p.mu.Unlock()
// buffer the terminal update to minimize cursor flickering // buffer output to minimize flickering on all terminals
// https://gitlab.gnome.org/GNOME/vte/-/issues/2837#note_2269501
p.buf.Reset() p.buf.Reset()
defer p.buf.WriteTo(p.w) defer p.buf.WriteTo(p.w)
// eliminate flickering on terminals that support synchronized output
fmt.Fprint(&p.buf, "\033[?2026h")
defer fmt.Fprint(&p.buf, "\033[?2026l")
fmt.Fprint(&p.buf, "\033[?25l") fmt.Fprint(&p.buf, "\033[?25l")
defer fmt.Fprint(&p.buf, "\033[?25h") defer fmt.Fprint(&p.buf, "\033[?25h")
......
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