Cat9 And LASH Want To Change Your Linux Command Line

It is no secret that to be a true Linux power user you have to deal with the command line. Many people actually prefer to use the command line. However, the shell — the program that provides that command line — is mired in a back history which means it has to work with existing things no matter how modern it tries to be. However, a new set of projects wants to replace most of your user interface stack starting with the shell. At the top of that stack is Cat9 which is technically a shell, but not in the way you probably imagine a shell.

A traditional shell lets you run programs one at a time, feed them input, and observe their output. Sure, you can stash the output away for later use. You can run programs in the background or in parallel, but that requires special attention. In Cat9, everything is asynchronous and results stay around until you deliberately drop them. It is trivial to grab data from a previous command or, for example, to switch to a directory that was in use by an earlier task.

According to the documentation, Cat9 uses Arcan which is painful to build (their words). It also uses LASH and, potentially, one of several unusual window managers. If you want to see what it can do — watch the video below.

You’ll notice that commands get tracked as jobs. A job number can be absolute (#5) or relative (#-1, the previous job). There are also special identifiers like #csel for the job that has the cursor or #last as a synonym for #-1.

If you simply run a command you essentially create a job, and start collecting its output. A job remembers its environment. The only problem is if you want to directly interact with a program like, say, a text editor. There is a way to force that type of execution so the normal way an ordinary shell runs a program is an exception for Cat9. You can, however, switch between jobs for input. You can also signal jobs, just as you can in a normal shell.

You can force commands to work in a job. For example, to see what directory the 4th job is using:

#4 pwd

Of course, you also need a way to get the data from a running job and that can be passed as input to other commands. There are more commands to control the view of output, so you can split screens, scroll through data, and more. Another important concept is that you can create triggers that execute when a job succeeds or fails.

Will you try cat9? It is hard to displace the existing window management and shell infrastructure. Wayland has been trying for 14 years and still has some ways to go. Odd shells come and go. Many language-specific shells that often model on other languages have strong niche followings, but rarely catch on in a significant way. Maybe Cat9 can be different. Or maybe some of its ideas will leak out into mainstream shells.

Some of the ideas are simple. For example, the prompt disappears after you move to a new line. Of course, if you are documenting a test run, that might break your workflow, but for most use cases, that makes sense. Why clutter the output with unnecessary data?

If you want a different shell that is closer to the norm, we looked at a number of them. Keep in mind, it isn’t really that Cat9 does anything a conventional shell can’t. It just, presumably, makes it easier.

Leave a Reply