The Shell I Want

I want a better shell. I know there are better shells, but I want one that’s even better than the better ones. I want it to understand everything I’m used to saying, but to do it in a way that’s smarter and easier.

When I’m at a prompt, and I type “ls”, I want the sequence of events to be something like this: I hit enter, and I immediately get a prompt back, which has a unique identifier in it, looking something like this:

> ls
ab17e>

Now, let’s say ls takes a while to respond. Maybe the machine is loaded, maybe the disk is slow, maybe there are a trillion files in that directory. I have a few choices: I can give up, and do this:

ab17e> kill

That just kills the process. “ab17e” is technically the identifier for the results, not the PID, but let’s just say my shell is REALLY smart. So smart it can figure out which process(es) to kill in the background by using this unique identifier.

Alternatively, I could do this:

ab17e> wc
ab17f>

This would run a wordcount on the results of that ls, and assign a new unique identifier to the results of that operation, whenever it becomes available. Now, let’s say for laughs that the ls finally returns. It doesn’t interrupt me where I am, it just populates behind the bookmark it saved for itself earlier, and my screen looks like this:

> ls
foo
bar
baz
ab17e> wc
ab17f>

It’s totally asynchronous, but I don’t have to care about it, and I don’t have to put an & after my ls to make it so, and maybe in most cases I don’t even notice that it’s asynchronous, because my blazing fast machine is so blazing fast.

It’s also a shell that optimizes for my use of the result of whatever I type, and it doesn’t force me to do things all at once, or to do them twice, or to avoid mistakes. In fact, if I get lost in the weeds, I can always go back to a previous result by referring to that unique ID and run something else on it- uniq or sort or whatever, but I don’t have to think about how to get that original list back.

If you think about it for about ten seconds, you will see that this shell is awesome, and maybe you will make it for me. If you do, please call it Pragmatic Shell, and imbue it with some pragmas as well, but I’ll have to write more about that another time.