4 ms·
Speaking of Go and terminals, is there a library that doesn't take over the whole screen? For example, let's say I want to display a three-line progress bar. I
by lobster_johnson 10y ago
Speaking of Go and terminals, is there a library that doesn't take over the whole screen? For example, let's say I want to display a three-line progress bar. I want to update just that three-line area, and when done, remove all the lines and continue from there, and otherwise just integrate into the text flow of the terminal.
- tene 10y agoI don't know about Go, but there's quite a nice similar library for Haskell, https://hackage.haskell.org/package/concurrent-output https://hackage.haskell.org/package/concurrent-output
- lobster_johnson 10y agoRight, I'd love something like that for Go.
- dtjohnnymonkey 10y agoYou might try this from my co-worker: https://github.com/sethgrid/multibar https://github.com/sethgrid/multibar
- atombender 10y agoNice, thanks. I'd like something like that, but generalized for any output, not just progress bars.
- heavenlyhash 10y agoI started writing the dumbest-possible thing-that-can-work here: https://godoc.org/github.com/polydawn/go-slog https://godoc.org/github.com/polydawn/go-slog but don't necessarily recommend it. (There's barely enough code there to be worth linking, honestly.) It doesn't do anything fancy -- certainly not like the progress bars linked in a sibling comment -- but it also works without setting the TTY into raw mode, which means your scrollback is never disrupted.