❔ Decent terminal UI library or solution
I'm writing a terminal-based application that requires a TUI. I've tried Terminal.Gui but I've found it quite bad, littered with all sorts of problems and missing simple things it doesn't do at all. I don't need a complex system, I'm writing a terminal-based debugger, so I'd need a few scrollable text views arranged in some grid and the ability to highlight portions of the source text when a breakpoint is hit or a statement is stepped. Any recommendations?
22 Replies
Ideally I wouldn't want to roll my own solution for this. The TUI portion of the project is merely a help until the debugger is finished, at which point I'll slap it behind a debug adapter and use it in VSC
$spectre
Spectre.Console is a .NET library that allows for easy creation of console UIs, text formatting in the console, and command-line argument parsing.
https://spectreconsole.net/
Spectre.Console - Welcome!
Spectre.Console is a .NET library that makes it easier to create beautiful console applications.
Spectre is 99% static, it's the other end of the spectrum
It doesn't even have a multiline text display that one could scroll
When I last used Terminal.Gui I made my own model-view system.
Worked perfectly.
But the only well-known Terminal GUI libraries are Terminal.Gui and Spectre.Console
https://www.nuget.org/packages?q=console+ui&frameworks=&tfms=&packagetype=&prerel=true&sortby=created-desc
Terminal.Gui is by far the most used/starred/downloaded
There's also Goblinfactory.Konsole
https://github.com/goblinfactory/konsole/
Do you perhaps have a project or some secret doc for it? (Terminal.Gui)
I've tried creating a scrollable textbox but didn't succeed, as one can't just add vertical scrolling to a dynamically sized textbox
I've also tried to divide a window 80%-20% in size (there's no fill-remaining-space option ofc) and 80 + 20 is apparently not 100
It was honestly a horrific experience to use, even if it's the most used one
It should be Dim.Fill()
Taken from their examples
Which will fill the remaining space, either Width or Height
Yeah I've tried that. I either screwed it up or I don't know then
I don't think I have tried creating a multiline TextField though
What about a scrollable text view?
As in, the debugged applications standard output is captured and is appended to a textview
Now, I see no way how you'd do this with a ScrollView, heck, I don't even know if I understand scroll view correctly, as I need to explicitly set the content size
And text view has some built-in scrolling AFAIK? But I can't even tell it reliably to jump to the bottom, and no way to summon a scroll-bar
🤔
TextView does have multi-line support and if it has a scroll-bar, then it should be fine?
Or not?
Unless it's a bug
https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui/Terminal.Gui.TextView.html
it has no scroll bar
It just happens to handle multiline text and I can scroll with the mouse in it, but that's all
Ah, I see.
Maybe post in discussions of Terminal.Gui?
If TextView does have a scroll function but not a scrollbar, I wonder how you can handle it.
If you maybe sync the Scroll-View offsets to Text-View's offset?
Maybe. I'll dabble with this still a little bit and look at Goblinfactory.Konsole too, but honestly, this is just a nice-to-have in the project
So if these all suck I'll just scrap the TUI
What's the TUI for out of curiosity?
terminal UI
I'm (LPeter) writing a terminal-based debugger,
ah sorry
Goblinfactory is meh, Terminal.Gui has been much better for me.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.