Skip to content
uilive is a go library for updating terminal output in realtime
Branch: master
Clone or download
boz and Greg Osuri Fix "infinite scrolling" issue. (#10)
Move up a line with ansi control code instead of down a line with '\r'.
Latest commit ac356e6 Mar 23, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc README: updated example Nov 19, 2015
example
.travis.yml added .travis.yml Nov 19, 2015
LICENSE
README.md README: added build stability badge Dec 11, 2015
doc.go uilive: doc updates Dec 4, 2015
example_test.go
writer.go Removing wrong lock (it locks inside flush). May 26, 2016
writer_posix.go
writer_test.go
writer_windows.go

README.md

uilive GoDoc Build Status

uilive is a go library for updating terminal output in realtime. It provides a buffered io.Writer that is flushed at a timed interval. uilive powers uiprogress.

Usage Example

Calling uilive.New() will create a new writer. To start rendering, simply call writer.Start() and update the ui by writing to the writer. Full source for the below example is in example/main.go.

writer := uilive.New()
// start listening for updates and render
writer.Start()

for i := 0; i <= 100; i++ {
  fmt.Fprintf(writer, "Downloading.. (%d/%d) GB\n", i, 100)
  time.Sleep(time.Millisecond * 5)
}

fmt.Fprintln(writer, "Finished: Downloaded 100GB")
writer.Stop() // flush and stop rendering

The above will render

example

Installation

$ go get -v github.com/gosuri/uilive
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.