C
C#14mo ago
LPeter1997

❔ 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
LPeter1997
LPeter199714mo ago
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
ero
ero14mo ago
$spectre
MODiX
MODiX14mo ago
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.
LPeter1997
LPeter199714mo ago
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
Buddy
Buddy14mo ago
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
Buddy
Buddy14mo ago
There's also Goblinfactory.Konsole https://github.com/goblinfactory/konsole/
LPeter1997
LPeter199714mo ago
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
Buddy
Buddy14mo ago
It should be Dim.Fill()
usernameText = new TextField ("") {
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,

// Fill remaining horizontal space
Width = Dim.Fill (),
};
usernameText = new TextField ("") {
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,

// Fill remaining horizontal space
Width = Dim.Fill (),
};
Taken from their examples Which will fill the remaining space, either Width or Height
LPeter1997
LPeter199714mo ago
Yeah I've tried that. I either screwed it up or I don't know then
Buddy
Buddy14mo ago
I don't think I have tried creating a multiline TextField though
LPeter1997
LPeter199714mo ago
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
Buddy
Buddy14mo ago
🤔 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
LPeter1997
LPeter199714mo ago
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
Buddy
Buddy14mo ago
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? catshrug
LPeter1997
LPeter199714mo ago
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
Thinker
Thinker14mo ago
What's the TUI for out of curiosity?
LPeter1997
LPeter199714mo ago
terminal UI
Buddy
Buddy14mo ago
I'm (LPeter) writing a terminal-based debugger,
Thinker
Thinker14mo ago
ah sorry
Buddy
Buddy14mo ago
Goblinfactory is meh, Terminal.Gui has been much better for me.
Accord
Accord14mo ago
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.