Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
f9c7ead1
Unverified
Commit
f9c7ead1
authored
Feb 17, 2025
by
Jeremy Schlatter
Browse files
cmd: eliminate flickering with synchronized output
parent
5930aaeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
progress/progress.go
progress/progress.go
+5
-2
No files found.
progress/progress.go
View file @
f9c7ead1
...
...
@@ -83,11 +83,14 @@ func (p *Progress) render() {
p
.
mu
.
Lock
()
defer
p
.
mu
.
Unlock
()
// buffer the terminal update to minimize cursor flickering
// https://gitlab.gnome.org/GNOME/vte/-/issues/2837#note_2269501
// buffer output to minimize flickering on all terminals
p
.
buf
.
Reset
()
defer
p
.
buf
.
WriteTo
(
p
.
w
)
// eliminate flickering on terminals that support synchronized output
fmt
.
Fprint
(
&
p
.
buf
,
"
\0
33[?2026h"
)
defer
fmt
.
Fprint
(
&
p
.
buf
,
"
\0
33[?2026l"
)
fmt
.
Fprint
(
&
p
.
buf
,
"
\0
33[?25l"
)
defer
fmt
.
Fprint
(
&
p
.
buf
,
"
\0
33[?25h"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment