This is still the header! Main site

Why are TUI apps better?


... they actually kinda aren't though.

This is post no. 31 for Kev Quirk's #100DaysToOffload challenge. The point is to write many things, not to write good ones. Please adjust quality expectations accordingly :)

UNIX is cool. You have simple, composable parts, everything is text that you can pipe, you have a flexible command line, and the entire thing is really powerful. In fact, Real Unix People will only have:

open. That's it. (Add a lot of rice for extra coolness.)

Of course, even if you're a Real Unix Person, you're allowed to have full-screen terminal apps running. In fact, htop is an excellent way to show off the number of your cores.

Meanwhile, GUI apps and fancy desktop environments tend to be horrible, bloated, slow, and will eat all your RAM. They're also a lot less powerful. And they need a lot of unneccesary clicking around.

Except... isn't... "more graphics"... an actual feature? Like, some people tend to make fun of TempleOS' 640x480 and 16 colors... while using text-only terminals with... probably not a whole lot more colors either?

Meanwhile, you don't really get all the Unix goodness with TUI apps. You can't pipe them, they usually don't have a command line UI, and they aren't composable.

... but...

... in fact, GUI apps are more bloated and less flexible quite some times. Meanwhile, TUI apps, like htop, quite some editors, Ranger the file manager, some music players, etc... tend to be lightweight and quick.

You might argue that this is because they're terminal apps... however, we did go from computers having megabytes of RAM to gigabytes now. It's not like making GUIs is actually hard from an absolute resource usage perspective, at least not the same way it was in the late 80s. And yet...

The difference has multiple reasons; I'm going to argue for three of them here:

... Minecraft Effect???

... yeah, I just made that name up. The point being: it's a whole lot easier to build a pretty house in Minecraft than in Blender.

In Minecraft, all you have is blocks. Especially on a smaller scale, there aren't that many design possibilities with them. So, while yours will not be as fancy as the best ones, the best ones are still... blocky.

Meanwhile, the best architecture built in Blender is fairly hard to distinguish from Actual Reality... and needs a lot of skills to do right. Yes, you can make a Minecraft-style house possibly even quicker than in Minecraft itself, but it will absolutely stand out.

Let's say you're building a htop clone in GTK. You could use GTK scroll bars as CPU meters, but... they'd look like a bunch of GTK scroll bars. You better end up having a CPU graph, with CRT scanline effects, adjustable colors, smoothing, etc. Unlike htop itself, which is fairly close to how pretty things could get in a terminal.


Mouse support for terminals is... kinda... optional. So TUI apps are usually keyboard first. Which, typically, makes them faster.

Nevertheless... did you know that for Windows 2.0 (3.0 maybe even?), having a mouse was optional?

And thus, they paid a lot of attention to keyboard shortcuts. You could use a well-designed early Windows app just from the keyboard.

This, of course, went downhill: the current "phone UI clone" wave of apps sometimes only support keyboards for accessibility purposes (... yes, you can tab through everything, but it'll be anything but fast).

This is yet another example of limitations (e.g. no mouse support) being turned into an asset for TUI apps.


There is also that it is a whole lot harder to build a GUI app, compared to a command-line or a TUI one. Want a TUI? Just link with ncurses and print some text with some pretty colors. Sure, it won't be an especially sophisticated one, but the basic building block is still "putting characters on the screen". Meanwhile, GUI toolkits have a gazillion of widgets, layouting algorithms, and it's not overly typical that you can just take a command-line tool and turn it into a GUI, without any major code changes.

Which, of course, leads us to...

... is it Lisp Machines again?

... of course it is. Along with TempleOS, which I already argued is 70% of the way towards Lisp Machines.

Actually, there is a surprising number of systems that have command lines that you can print graphical objects onto. Lisp Machines had CLIM, which, if I remember correctly, had the concept of a kind of output stream that you print put graphical elements onto; these remained connected to the original objects, so you could even interact with them (while still staying in a kind of terminal window).

This way, "adding a GUI" wasn't an all-or-nothing question. If you needed your command line app to show an image, you just did it. If you needed to make it clickable, you hooked up callbacks. Slowly, this could turn into an entire GUI, with buttons (... which invoked commands you already had a command line for) and various panels. You didn't have to throw away the flexibility for convenience.

Neither Lisp Machines nor TempleOS is especially into doing this over a network, but it's still interesting to imagine an alternative present where ssh-ing into a server does bring you a UI that's fancier than a stream of characters with ANSI escape codes. It's fairly likely that in such a world, "TUI apps" wouldn't even be a separate category.

(What this implies as for the quality of apps in such a universe is left as an excercise to the reader.)

... comments welcome, either in email or on the (eventual) Mastodon post on Fosstodon.