Hacker News new | ask | show | jobs
by KirinDave 3636 days ago
Actually, let me unflip that table.

I am desperate for someone to come along and realize that the current terminal interface is a perpetual train wreck, and that if we can break compatibility but end up with something better we should.

Consider for a moment what a monumental task it is to make a simple ncurses menu and status bar in bash script. Consider for a second how trivial that could be made if each command line entry were a small flexible webview.

Imagine if you typed netstat and it showed the results, but there was also a field where you could key in text narrowing queries as part of the standard presentation for all very long input. No more appealing to grep or more and losing context or blasting your scrollback buffer.

Consider for a moment if we could move away from trivial line interfaces for SSH and towards a protocol that actually handles sessions and works over SSL in every conceivable network environment. Hell, most people I know have migrated to mosh and only type ssh when they're provisioning fresh cloud instances (usually to get mosh on there as fast as humanly possible).

The entire idea that "text is a superior interface" is correct as an input mechanism, but not necessarily as a data presentation mechanism. HTML and some basic es2015/typescript/whatever isn't just flat out better than bash for this sort of thing, but it flows from a long history of tools like tcl/tk trying to make the shell a more efficient and effective place to visualize trivial data.

I've been using terminals since 80 characters was a luxury and amber was the fancy new color, and for at least 20 of those years I've been hoping we'll see something that keeps the composability of shell scripting but introduces a non-line oriented protocol that could also offer presentation logic when appropriate.

We could preserve all of that if we just pretend all existing shell commands return a (forgive the templating syntax, it'll be understandable by a wide audience) Map<Stream<Text>> where {'stdout': <stdout>} and additional data can be offered around that with trivial API additions.

Please, let's not pretend we'd not benefit massively from richer tooling here.

4 comments

> Please, let's not pretend we'd not benefit massively from richer tooling here.

Absolutely nothing about this project or the way they went about building it shows any tendency towards richer tooling. A web interface also does not inherently enable richer tooling. You could implement this non-line oriented protocol entirely without 500+ MB of JS and the interpretation of that data could obviously be done without it too.

Edit:

While I understand your rants all over these threads (it doesn't inherently have to be inefficient and bloated), you've picked a strange submission to take these fights in. The software in question is in fact bloated, not compliant and is really only an interface to aliases.

Also, I would add: The proof is in the pudding. You seem to have made this a personal crusade, so I would urge you to make a decent PoC with these ideas to show the world.

> you've picked a strange submission to take these fights in.

I don't see how that's germane. I didn't object to concrete references to the software (which is not as good as other submissions). I objected to knee-jerk silverbacking.

> You seem to have made this a personal crusade,

No, but I am so tired of people on HN mimicking the style of development we put together in the 80's and 90's because... well I have my opinions about this practice, but they're uncharitable. We'll leave it at that.

There is a cult of terminals in our industry that has fundamentally missed why terminals were an effective interface and throw shade on anything that isn't a terminal, even when it's actually a refinement on the terminal concepts.

> Consider for a moment what a monumental task it is to make a simple ncurses menu and status bar in bash script.

It really isn't, see e.g. whiptail.

And using ncurses for anything today is not a good idea. Surviving terminals are overwhelmingly ANSI, and can be supported by a single codebase that uses escape sequences directly, wihtout the horrors of ncurses.

I have seen whiptail. It's still easier to make a list of selectable options in html or markdown.
In your vision where text is not the universal interface, how would Unix pipes work? After all, often the output of one tool is the input of another – that usually has not been written to interact with the first.
Powershell accomplishes this by making the pipes pass tagged objects around containing streams. This actually has a lot of nice properties when you go to manipulate the objects programatically.

And it's a logical extension of the UNIX stream model, where in reality you're passing around a whole heck of a lot more than text when you type 'cat | sed'. You're passing environment context, multiple streams, etc.

The idea that this is "more complex" than unix pipes is understandable, but the reality is that IPC is pretty complex and a whole lot of magic and shared expectations go into the "simplicity" that bash offers. And even then that model breaks down all the time (e.g., as Docker becomes common as a deploy target the idea that you should output error conditions to STDERR has rapidly become problematic).

I do not understand what is the problem when using Docker. Please explain?
It's somewhat involved, but life is a lot easier if your Docker containers just log everything to stdout, when you go to ship software that uses them.

Stderr is sort of an annoying detail. Especially given how inconsistent output to it is and how it has different rules for how output flushes.

How do you imagine scrollback/ history on such thing? Genuinely curious. Have seen a few projects attempting this, but having all of the output searchable is a very central feature of terminal, for me.