377 points · by wey-gu · 4y ago · 99 comments
I think this solves some of the web's browser problems by breaking things out into components:
- browsers are way too complicated to build, terminals are way easier
- browsers have a huge attack surface, terminals are smaller
- browsers lock you into JavaScript (more or less), terminals don't
- browsers have to support tons of backwards compatibility (quirks mode, TLS), terminals have less to support by being more circumspect
It feels like we're on the beginning of the next cycle a little. First we scattered a bunch of apps to see how we should use the internet, then we focused on the browser, now we're scattering some more apps to see which solves our new problems better.
To that end, presuming we stick with terminals, I wonder if they're at risk of falling prey to the same problems, or if they have different potholes in their future. One thing in particular I saw someone else mention in a comment in a different thread is that terminals are almost all written in unsafe languages like C, which feels super bad. Something else is auth and identity--something the current web is pretty bad at.
I think most terminal emulator developers would dispute this -- there's a lot of complex legacy behavior in TTY/PTY handling, in supporting various escape sequences, being behavior-compatible with dominant emulators like XTerm, etc. Most of it is also "esoteric" in a way that backwards compatibility on the web isn't, since very little is actually standardized (the only pieces I can think of are POSIX for some parts of the PTY layer and X3.64 for some terminal control sequences).
> ...It feels like we're on the beginning of the next cycle a little. First we scattered a bunch of apps to see how we should use the internet, then we focused on the browser, now we're scattering some more apps to see which solves our new problems better...
Is something that i also have been thinking about myself. I'm seeing the popularity - maybe resurgence - of text based web browsers as well as the Gemini protocol and associated Gopher sites (Capsules i think they're called?) really rise a bunch lately. I'll add that the prevalence of many devs/techies to implement ad blockers, maybe tweak their browsers to avoid running javascript, etc...to represent some shift towards more minimal interfaces for accomplishing their needs. And, simply blanket re-using of old interfaces (some decades old) without some adjustment might not scale to current-day needs in some cases. I myself look forward to these types of TUI experiments (including taking old text-based interfaces and evolving them for nowadays), as i'm optimistic some will stick around.
I think one of the bigger barriers is that terminals don't really have a component reuse boundary.
What I mean by that is: in the browser, you can always put more HTML inside a div tag, and generally speaking, it's gonna stay within the boundaries of that div tag, and things will compose and it won't be a fuss. In the terminal: what's the equivalent of that?
It's possible, and yet not actually remotely pleasant, to make a new PTY/TTY for each component (or each small application that you want to embed within another), and then grab the state of that PTY and replicate it into a rectangular region in another PTY that's bigger. There's so, so, SO much friction in this, though. It also only solves the view bounding: it doesn't solve, for example, the ability to have a copy/paste operation that works on the interior content in a standard way (instead each terminal application solves that itself, usually with some unique bespoke shortcut sequence, because you need _application logic_ to find text ranges since what's rendered to a terminal vs what the logical text state is are usually different).
I think if someone created some very basic component-oriented UI system to solve the composition problem -- then kept most of the components as roughly PTY/TTY and TUI concepts! -- it could lead to interesting places that PTY stuff will have difficulty getting to alone.
Protocol: https://github.com/rendicott/uggly
Client with gif demo: https://github.com/rendicott/uggly-client
I just built a new app (https://lists.sh — launching tomorrow) which leverages the charm toolset. It was a ton of fun to build and I think the workflow for publishing blog posts is more convenient than virtually every other blog platform I’ve tried.
At that point I think you're about as safe as "Generic PHP Web App" - I'm sure I've missed something, but that's where I'd start looking.
If you're on the hunt for one that isn't, check out wezterm, it's delightfully good.
I don't mean to insult what you've done, but accessiblity is (in my experience) one of those things which is really hard to add retroactively to systems.
That said I don’t think the point of this is to replace sed, or other unix-y tools where you’re having pipeline-oriented programs. It’s full blown apps inside of the terminal that might otherwise be in the browser or in a GUI. Something where you’re seeing things update or otherwise interacting such that you could never grab it’s out for a shell script nor would want to.. like running a REPL or top.
What I want is terminal apps that seamlessly integrate with all the standard conventions of the terminal. Your example of history is a great one. Another is, wherever possible enabling things like vi-style navigation, minimal need to move your hands off the home row, seamless integration with command line tools (implementing a search function - don't! let me pipe it through my own one, eg: grep).
As soon as I have to hit function keys, manually navigate to control UI elements etc. it's just a really bad recreation of what we already have in the browser.
That sounds like a you problem
But seriously, I'm the same, Python is a problem because it is such a great local optimum for this kind of thing - and yet a terrible global optimum. Ten years ago it made sense but now it is actively in the way of better alternatives, of which there are now plenty, gaining traction.
I don't see a products section on their site yet, but they refer in several places to what they are making as products, so I'm assuming they may want to market them to me in the future.
>we are building technology that lets Textual apps run in a web browser (no code changes required)
Excited to see how that turns out.
so close, and yet so far away!
One view of things is that means the Textualize developers were probably web developers and they wished Text UI programming was similar.
The most mainstream Graphical UI on desktop that allows using CSS for layout is Electron which is basically an entire Chromium browser running a single web application with HTML, CSS, and Javascript heavily involved.
Therefore, one potential "end-game" for Textualize is to add enough features that it becomes a browser itself or to be supplanted by Electron adding Text UI support.
There's enough UI real state for everyone.
(It's an impressive achievement on a technical level, sure. But that's orthogonal to whether it's useful, and for practical purposes it's not. "Any tty will do" is a good thing.)
You might find a really old terminal emulator where it struggles, but it would be the exception and not the rule.
That said, if your terminal support is as good as advertised, it probably shouldn't be hard to surface that on your site. (If you really want to sell me on it, let me try it out in a web-based terminal emulator like xterm.js! Then let me package up that test script for download, so I can easily run it locally in my terminal, as many of them as I like, and see for myself how well it works there.) Maybe also include feature coverage in your test suite and even CI, although that's definitely a trickier engineering problem.
As it is, I'd be very hesitant to use the library since doing so would risk incurring a dependency (on the user using a supported terminal) that wouldn't be easy to characterize more closely than "I tried this in xterm, y, and z and it worked, but if it breaks for you I'll have no immediate idea of why, and I'll have to choose between #wontfix and losing velocity on feature work."
However, 10MB is still enough to run Windows 3.1 with room to spare for a program or two.
For comparison, XTerm uses around 2.5MB, and that's a relatively bloated and crufty piece of software.
But I really think that textual interfaces were a mistake. This thing was inherited from Unix which was made in the 70s or so.
All screens now are graphical so why are we programming as if the "standard output" is a text file?
We should be writing code that writes to a pixel buffer instead of to a file handle.
It's 2022 and there's still no good GUI debugger for C on linux.
Someone tweeted this a few days ago which I thought really captures why text is a poor UI:
> It's 2022 and the two common debugging methods on Linux—"just printf" and "gdb -tui if that's not enough"—still can't be used at the same time without it screwing up.
We rolled out the PCs and updated software and salespeople’s and CSRs’ productivity was killed. They could fill in the screens on the old system before it finished painting.
The new one had the same “screens”, but flipping to the mouse and back was awful. A year later the vendor finally got everything straight with the keyboard (tab order, hot keys, etc). But it still took longer to render and blocked input and was generally awkward.
I set them up with telnet on their PCs back to the VAX. New folks found the GUI easier, but experienced users still hated it.
Eventually the vendor required moving the DB off the VAX and the TUI was dead.
I had started building web UIs by then. Thick clients were already becoming passé. But that experience really has stuck with me.
The tech you use doesn’t actually matter at all. Enabling people to work faster, better, easier is what matters.
Sometimes a short-term but steeper learning curve is better in the long run. Sometimes ease of adoption is more important. And sometimes the tech doesn’t change the fact that a tool just sucks.
Good tech becomes an extension of human ability. I love vim and awk. I’d rather write documents in troff or LaTeX w/ git. But I also love Pixelmator and actually even outlook these days. I feel awkward without them.
Interestingly, as I type this, I can’t think of a single web UI that I have that unconscious relationship with.
I fail to see how this is an argument in favor of TUIs in principle.
The tech isn’t the principle. The experience is. Use the right thing for for the audience. Use a GUI, use a TUI, use a basic CLI tool for day-to-day. And sometimes that can even be additive where more than one is the right answer.
The clicks stuff in this does feel silly to me. But I think that sometimes there’s value in not reaching for a mouse.
If you care about the tech in principle, then I think the answer is to work on a library/framework you love, like they did, vs a user app.
I’m not reinventing those wheels, and will borrow stuff like this when it seems right. And anything is better than curses :).
My own experience is that text user interfaces over mosh work far better than web applications when on a crappy connection.
My experience isn't specifically with textualized-based applications though (one is irssi, the terminal IRC client, and some with proprietary applications from $work).
Look at how sparing vim is with screen updates. I don’t know if it was intentional, but works out nicely, and makes it a godsend if what you have is 3G which is somehow worse than EDGE has been 15 years ago.
I have a hunch this TUI would struggle in these circumstances.
I love so many term features but they're at odds with me when i have a larger font size. Suddenly by having my coding text slightly larger i lose screen real estate because all of my borders and widgets are big font characters too.
Is there a good way to have bigger primary font with smaller TUI borders/widgets/etc? What would a good way look like?
Hypothetically some simple restrictions for variable font sizes could keep the simplicity of TUI while also empowering the UX. Similar to how variable colors didn't suddenly make this a "GUI".
The only way variable font sizes work without being isomorphic to a GUI is if the sizes are a series of power-of-N multiples of some base size for some integer N. (Realistically, N=2 is the most likely, though N=3 might sometimes make sense.)
The reason for power of N is that it assures that any set of available sizes used still fit on a grid of the smallest size actually used.
Like, a variable font size such that a letter can be just one pixel high and wide? Yeah, that's a GUI. But I rather prefer GPU accelerated GUIs ;-)
Makes it a bit more complex though if the block sizes make subdivision like this difficult, though. This isn't an idea for an implementation necessarily, rather just an idea to illustrate my request. I want to have larger font size than my gutters/etc in my term editors.
Seems basically python https://github.com/Textualize/textual .
We had document/text oriented interfaces in the 80s that were also graphical like in Genera, a lisp machine OS https://en.wikipedia.org/wiki/Genera_(operating_system) This should have been the direction we should have followed. Instead, Unix and X Window systems - the most expensive way to run a teletypewriter - some how won out in the economics of things.
I hope the current approach of fancy terminal apps is just a local minimum we can kick ourselves out of in he long term.
Note that Genera itself is, AFAIK, proprietary software. But its predecessor (or at least one of them) has been released as Open Source.
http://www.unlambda.com/index.php?n=Main.Mit
HN'ers interested in experimenting with this direction in computing might find the old Lisp Machine code of interest.
We call those Jupyter notebooks these days.