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.

44 thoughts on “Cat9 And LASH Want To Change Your Linux Command Line

  1. Wayland is never going to replace X11, simply because it’s worse at a fundamental level. It eschews the UNIX philosophy, and abandons the client/server model. One of the best things about X11 is its network transparency and X11 forwarding.

      1. I don’t understand the technicals, but I’ve never had much issue forwarding X11 to machines over a network. It “just works”, even connecting from Windows (though it’s ugly without GTK/Qt/whatever themes).

        These days I use xrdp, which I’m pretty sure is only possible thanks to X11’s networking. Though maybe not in the default setup of using xVNC or whatever it is.

        Wayland seemed like it might have been good for my KDE dual desktop setup, but that was years ago and I became so frustrated with Linux multimonitor that I just went back to Windows and using VM’s lol.

        1. xrdp and xvnc have almost nothing to do with X11’s client/server architecture, they just expose a virtual X11 display over RDP or VNC. In fact, half of why they exist is that using the native networking support in X11 is so hard to get right.

          X11 forwarding over SSH (for example, using OpenSSH’s -Y option) is the type of thing being discussed when people talk about X11’s native networking, though it’s not a great example because the SSH client hides all the complex and fragile parts from you. And, TBH, it’s just about the only way the native networking is used at all in modern systems (and waypipe covers that use case reasonably well).

          Now, that said, AFAIK, Wayland has no good way currently for a truly headless system to export a virtual display over RDP or VNC, so X11 does still have an advantage in that respect, but that’s a pretty niche use case.

      1. systemd has good ideas, but fails to implement them sanely (or securely), IMO.

        To quote one software package maintainer:
        systemd for each feature has 3 versions: where it ‘works’, where it starts to really work, and where it gets deprecated and replaced with a similar feature, but no longer compatible.

  2. Will I try Cat9? No. I cannot see why I would want to. I use CLI all the damn time and the vast majority of commands I type are ones whose output is only relevant right there and then, so capturing the output into a billion different buffers that I have to then manually delete would be a nightmare. In a similar vein, the vast, vast majority of commands do not warrant turning each and every single one of them into a separate “job”

    Maybe Cat9 makes sense, if you primarily just copypaste commands from somewhere into CLI, but I cannot see how it’d be preferable over just a regular shell + tmux for actively working on anything.

  3. I run a number of ‘linux’ machines – and don’t have a gui installed on any of them.. Cat9 looks completely woeful for the things I normally do – and if I want a few separately running things at the command line level gnu screen more than easily handles it…
    So no, I won’t be trying it..

  4. 90% of my terminal use are the same commands every day such as changing directories, running an apt update shell script with a download rate limiter in the background. I’d like if a shell took a leaf from the predictive text of mobile fones and made a statistical analysis of my commands to suggest what i was going to type next. Then i could press one key and be done.

    1. Tasks that you repeat often would be easy to just write a script for or add an alias for, like e.g. your apt update. I’ve got an alias “aptu” for “apt update && apt -y dist-upgrade && apt -y autoremove”, for example. You really don’t need predictive text for repeating tasks like that.

      1. Why bother with a script. Just up arrow, Enter and off you go :) .

        As above, most of what I do with a command line is already handled. Doubt I’d try cat9/lash as bash works well for me as is. If things need to get more ‘complicated’ then a simple bash script can be written, and if I have to start using a bunch of if/then logic, off to Python, and if that can’t handle it off to c/c++, pascal, Rust, whatever. Why reinvent the wheel?

    2. >>Then i could press one key and be done.
      Most shells will allow you to press ctrl-r , start typing , and it will match a recent issued command. That might be safer than suggesting commands by use of statistical analysis.

    3. It sounds like you should try fish shell. It’s occasionally annoying for it’s lack of bashisms but for running routine commands it is very useful. It has history and context aware prediction/suggestions.

  5. “Dealing with” the command shell is not really an issue for me. It’s a tool I use when I need it.

    Also, whatever its shortcomings may be (I’m perfectly happy with it), I see no need to reinvent either Unix or Linux. I don’t think they’ve aged badly.

    And, as I’ve said several times before, Linux doesn’t suck any worse than Windows (and has the additional benefit of not having some megacorp changing how it works at their whim)

    1. Agreed. I mean especially for headless servers, where raw command line is actually essential, this won’t even work since it needs a window manager.

      CLI all the way, and if you want something “nice” for your headless Linux machines then install Webmin :D

  6. I find what powershell did a lot more interesting. Commands outputs are streams of objects rather than a stream of text or binary data. Every command is aware of the objects so you can access the data you need in the output without having to parse the text every time, or even access files metadata etc…

  7. So it’s a new TUI paradigm, and it seems pretty cool, but…. I need a Window Manager? Won’t work over SSH or on a text-only terminal server? Seems kind of pointless, sadly. Like someone else said, why not just have multiple bash windows. And use a text document to copy/paste command output. Easier than remembering arbitrary command/task numbers!

    Cool effort, don’t get me wrong. I’m always into paradigm-shifting-attempts with UI. But a new TUI that still requires GUI stuff and a WM seems more like a fun idea rather than a functional one.

  8. I have been wanting a way to embed graphics into the command line for some time now — I wish I could see “zoomable” pictures and scrollable PDFs in the command line, accessable via scrolling, so I could have my “stream-of-command-consciousness” captured in a way kindof like Jupyter notebook cells.

    At least one feature of cat9 interferes with this: making “empty” commands disappear prevents me from seeing my history of thought.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.