

11·
5 hours agoMost languages have a fancy TUI library nowadays that makes it pretty easy. Here are a few:
The difficult parts are generally:
- Designing what it should look like
- Dealing with all the interaction options
- Making it all discoverable for your users

Generally, yes, adapting to the size of the window is pretty easy. Most of those libraries have a layout engine, so you define the size of things relative to the size of the window and each other, then the layout engine takes care of the rest.
As for discoverability, well, it’s a hard issue in all UI schemes, and tends to be particularly difficult in CLI/TUI applications due to layout and input constraints. In a GUI application users can click on buttons, scroll, and generally figure things out. For a tui, there are probably going to be a large number of (possibly reconfigurable) keyboard shortcuts and maybe some sort of command system. How you let the user know about all of them without having to memorize a giant table can be difficult. The common options I’ve seen are a “?” popup (lazygit), a context-aware small popup during multi-key commands (helix), a command palette with search (lots), a top menu bar with accelerator keys (old school WordPerfect), or a bottom bar with context available options (lots). They all have their respective tradeoffs, and can make something go from “useable after hours of practice and reading” to “oh, this is intuitive!”.