For an upcoming tool I want an in-terminal GUI (not exactly like it, just to show roughly what I even mean by "terminal GUI"
Y'know, arrow-key-navigable menus, perhaps a list view / master-detail split view..
Been away from the Go ecosystem for some ~3 years now so I'm a bit out of touch with all the neat packages that have been written.
Anyone experimented with any such packages, assuming there are any? Ideally tested with both win and *nix..
Any recommendations / experiences to share?
评论:
ChristophBerger:
Raekel:Funny coincidence - I planned my next blog post to be about TUI libs.I haven't done research yet, but these come to mind:
jroimartin/gocui
nsf/termbox-go
gdamore/tcell
gizak/termui
(All hosted on GitHub)
Edit: CUI -> TUI
ChristophBerger:Will you post the post on this subreddit? I'm interested in what you have to say. A good overview would be great.
meta_leap:Sure I'll do!
titpetric:Thx, looking great, especially gocui at first glance! =)
Chillance:+1 for gizak/termui - it's used in ctop.
ChristophBerger:Yes, as /u/nagvx said, termui and gocui use termbox underneath. Anyway, will you also talk about how well they are in regards of positioning and resizing panels? When I did https://github.com/Chillance/sgo I ended up using termui because it had better "window" management in that regard, although it's not perfect. I was hoping to use a TUI which was flexible both width and height wise when it came to the panels/widgets you are using inside the terminal, so when you resize the terminal, everything inside just adapts nicely.
driusan:I plan to define a very simple test application that includes a set of features, e.g. input, output, panels, etc. and then try to implement this application with some of the popular TUI libraries.
Don't expect too much though. My time is limited, and thus the feature set will certainly be a very basic one, just enough to get a taste of each of the libraries.
ChristophBerger:Is there any chance I could convince you to include a matrix of which libs support which OSes in your blog post? The cross platform compatibility of Go is one of my favourite parts of the language, but I've pretty much given up finding something that works well across the platforms I use when it comes to terminal libs..
nagvx:Good point! But for this I have to rely on the data that the lib owners provide. I can only test on macOS and maybe also on Linux if time permits. I have no Windows around, nor any other OSes.
markole:This is a bit misleading, as both termui and gocui use termbox underneath. The two leading low-level libraries available (afaik) are tcell and termbox.
0xjnml:The term you are searching for is TUI.
