5 ms·
I can make a TUI by just reading from stdin, writing to stdout, and some minimal parsing and emitting of VT codes that have mostly not changed in a few decades.
by Arnavion 5y ago
I can make a TUI by just reading from stdin, writing to stdout, and some minimal parsing and emitting of VT codes that have mostly not changed in a few decades.
To make a GUI I have to pull in megabytes of libraries, learn their API, then update them every time they release a new version that will likely have breaking changes. They'll also have questionable bindings outside of one or two "first-class" languages, so reading docs and investigating why something isn't working is harder.
I'll stick with TUIs, thanks.
- hahajk 5y agoWeb interfaces are the GUI equivalent of the simple, timeless tty interface. My 10 year old router still renders html just fine on modern Chrome.
- Arnavion 5y agoYes, but at the cost of needing to run a browser. In this modern era of everyone fetishizing single-instance applications, a browser crash caused by one tab would mean I lose not only all my open websites but also all these "apps". I have to `pkill -9` firefox once every few days because of bugs; a few months ago it used to break the clipboard until it was restarted, these days it freezes when dragging tabs around in the tab bar, tomorrow I'm sure it'll be some new bug... I'm glad I don't lose my editor / IDE / chat clients / monitoring dashboards when this happens.
- likeclockwork 5y agoAnd after all that work you can't even use your GUI over SSH.
- Izkata 5y agoSure, with X11 forwarding.
- saulpw 5y agoYou can't use your GUI over 9600 bps serial port (yes this is sometimes still relevant).
- wutbrodo 5y agoOr even just a shitty wifi connection in an underdeveloped region or area.
- II2II 5y agoThe major desktop and workstation operating systems usually have an SSH client installed by default. The same cannot be said for X11. It is easy enough to use X11 on a mobile device. You may be able to get an X client for a mobile device, but I wouldn't want to use it. (Not to mention that some X11 software doesn't seem to work across the network these days, which causes me no end of frustration since RDP is usually fantastic. Not to mention the bandwidth requirements of graphical sessions, which is a concern over mobile networks.)
- IshKebab 5y agoWindows doesn't have an SSH client installed by default. But I agree with your point - setting up SSH is way easier than X11 and X11 doesn't even work that well over the internet. VNC would be a more reasonable answer but that is a pain to set up server-side on Linux and isn't very good. Really NX4 is the answer but it costs an absolute fortune.
- deleted 5y ago[deleted]
- IshKebab 5y agoWeb UIs solve most of that - even easier to implement than TUIs and you can use them remotely. The only big issues I have with them are security (most don't restrict connections to the same user and I wouldn't be surprised if a lot of them listen on 0.0.0.0) and launching them. There isn't a good cross-platform way to launch a browser.
- pcr910303 5y agoThat's an argument for making GUI libraries more ergonomic, not to keep making TUIs. And TUIs made by "just printing VT codes" will break when you resize the terminal, change the font size, or more.
- zozbot234 5y agoTUI's can deal with changes in terminal geometry, generally by redrawing. It even works in a telnet/ssh connection, the remote host gets sent that information and uses it accordingly.
- pcr910303 5y agoYes, it does. But then creating TUIs now require as much complexity as creating single window GUIs (requiring handling events outside the program), and you lose the aspect of 'creating TUIs are just printing VT codes'.
- gnubison 5y agoRedrawing a TUI from scratch is usually trivial. Certainly far simpler than your average GUI.
- marssaxman 5y agoIt's far less complexity, even still, and it has not changed much for decades. A TUI program working today will likely continue to work for decades more. If you don't care about glitz and just want to write something useful, that's a substantial draw.
- RobertMiller 5y ago> But then creating TUIs now require as much complexity as creating single window GUIs (requiring handling events outside the program) No way dude. All you need to do is catch SIGWINCH and then ioctl/TIOCGWINSZ to get the new size. Back when I was into roguelike development, responding to the terminal resizing took scarcely more than a half dozen lines of C. I wish I knew of a GUI system this simple.
- jrm4 5y agoRight, I don't think you and OP are in conflict at all. Basically, GUIs presently suck. The average perfomance differences between TUI's and GUI's point directly to the fact that GUIs are very very bloated. There's no reason that a GUI shouldn't be as performant as a TUI, given the relative minimum it ought to take to convert one to another. A little vector here and raster support there should mostly take care of it.
- GeneralMaximus 5y agoThen you make your software unusable for everyone who needs to use languages other than English. For example, I can't reliably type Devanagari (the script used by Hindi, Marathi, Nepali, and a bunch of other South Asian languages) into any terminal on any operating system. You also make your software unusable for people who use assistive software. TUIs are not accessible by default, GUIs can be with only a tiny bit of effort. TUIs are perfectly fine for internal tooling, but any piece of software intended for general distribution should ship with a proper GUI. Even a basic Electron UI beats TUI in terms of accessibility and internationalization support.
- Arnavion 5y agoMy terminal (foot) supports IME just fine, using the same protocol that a GUI application uses.
- GeneralMaximus 5y agoIt's not just about the IME. I'm on macOS, where it's possible to type Devanagari/Gurumukhi into both iTerm and Terminal.app without any issues. However, neither of the emulators can render the typed text correctly. I tried typing "नमस्ते" into both just now, and they both broke in different ways. Here's iTerm failing to render a half स: https://imgur.com/a/vg1i4aB https://imgur.com/a/vg1i4aB Here's Terminal.app messing up how the quotation mark gets rendered: https://imgur.com/a/B5zd85V https://imgur.com/a/B5zd85V Can foot handle this case? What about GNOME Terminal, Konsole, and Windows Terminal? If I can't reliably read Hindi text on the commonly used terminal emulators on all three major operating systems, then from my perspective a TUI app is worse in every way compared to a native GUI app or even an Electron app.
- dotancohen 5y agoHow is this, in KDE's Konsole? https://imgur.com/a/xYjUQRv https://imgur.com/a/xYjUQRv
- mnsc 5y ago