Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Zellij: A terminal workspace with batteries included (zellij.dev)
174 points by thunderbong on May 25, 2024 | hide | past | favorite | 40 comments


I really respect what the maintainer is doing: Save up, work on something awesome full time, hope that people will love it and help keep it going. Some might call it naive, I call it bold.

(No affiliation, I just want to be like them when I grow up.)


Don’t wait to grow up. The sooner you fail, the sooner you’ll succeed.


I like where your head is at, but one does need some runway.


Zellij is pretty great, and I recommend others check it out. The UI is extremely slick, and getting a comfortable setup is nicer (to me) than tmux or screen.

Unfortunately, it's missing one key feature that keeps me from using it as a daily-driver: it doesn't appear to be possible to attach to an existing session by automatically creating a new tab or pane. iTerm2 has fantastic integration with tmux that allows it to directly create a new tmux tab for every native iTerm2 split or tab, and I was hoping to recreate that with Zellij, outside of iTerm2.

It _is_ possible to open a new tab with the `new-tab` action (or whatever it's called), but unfortunately, there's no way to do that "in the background": one of your open sessions always switches to that new tab when it opens. I don't know if this is a limitation of the session/tab system, but when I dug through the source, I couldn't for the life of me figure out why this was happening.

I did spend some time trying to contribute a flag to allow attaching to existing sessions with a new tab/pane, but the actual architecture in place back then made this very difficult to support without non-trivial refactoring (and at least at the time, Zellij wasn't accepting any major contributions that weren't directly aligned with the roadmap, which I respect: there's only enough time in the day to review random PRs).

I check back periodically; if this is made possible at some point, I'd love to switch to it.


I'm a Linux user so of course I think like this, but: why use the native terminal tabs? I use Kitty with window decorations turned off, and Zellij provides all the UI I need.


You're right, good question. At least partially, habit and muscle memory. I'm used to the keybindings, and the behavior for navigating tabs/splits/panes (across macOS, Windows, and Linux).

But also, native splits/panes and tabs cover 90% of what I really want from a multiplexer, so it's easier for me personally to stick with familiar behavior than to integrate another tool into my workflow just to recreate it.


That has nothing to do with you being a linux user.


I feel similar in that there are great strengths but some things are missing. I love that mouse highlight-to-copy will wrap within the current pane rather than span panes. But mouse pane re-size like in tmux is currently not available.


Most of the problems with zellij people have initially can be fixed if they write the config file from bottom up..just comment everything out and you'll get to your desired config in 15 minutes.

Use the 'clear-defaults=true' option for each mode and build the config.

E.g.resize mode for me looks like this

  resize clear-defaults=true {
        bind "Esc" { SwitchToMode "Normal"; }
        bind "h" { Resize "Increase Left"; }
        bind "j" { Resize "Increase Down"; }
        bind "k" { Resize "Increase Up"; }
        bind "l" { Resize "Increase Right"; }
    }

Normal mode:

  normal clear-defaults=true {

        // Quit/detach
        bind "Alt x" { Quit; }
        bind "Alt d" { Detach; }

        // Switch modes
        bind "Alt p" { SwitchToMode "pane"; }
        bind "Alt r" { SwitchToMode "resize"; }
        bind "Alt t" { SwitchToMode "tab"; }
        bind "Alt s" { SwitchToMode "scroll"; }
        bind "Alt m" { SwitchToMode "move"; }

        // new pane or resize pane
        bind "Alt n" { NewPane; }
        bind "Alt >" { Resize "Increase"; }
        bind "Alt <" { Resize "Decrease"; }

        // move between panes (moves tabs if at the last pane)
        bind "Alt h" { MoveFocusOrTab "Left"; }
        bind "Alt j" { MoveFocus "Down"; }
        bind "Alt k" { MoveFocus "Up"; }
        bind "Alt l" { MoveFocusOrTab "Right"; }

        // swap layouts
        bind "Alt {" { PreviousSwapLayout; }
        bind "Alt }" { NextSwapLayout; }

        bind "Alt 1" { GoToTab 1; }
        bind "Alt 2" { GoToTab 2; }
        bind "Alt 3" { GoToTab 3; }
        bind "Alt 4" { GoToTab 4; }
        bind "Alt 5" { GoToTab 5; }
    }


a good tool should be usable without custom configs


No, it shouldn't.


If anyone believes this, they can't seriously be surprised when most people can't be bothered to learn their superior tool.

Most people's first experience with a new tool will be to launch it with the default configuration and get a feel for it. That is an abysmal experience with far too many tools, so people go back to what they were already comfortable with even if its potential is more limited.

There's some nuance here when distributions change the default config. For example, some distributions made vim act like vi by default, while others enabled a reasonable set of modern features. People can form completely different opinions of the vim experience based entirely on what distribution they happened to try it on first, and you can't exactly blame the users for that.


Zellij is brilliant, especially with the plugin ecosystem being wasm based, which helps a lot with managing and cataloguing plugins


I use GNU screen and the plugins seem like a selling point, but what plugins are there right now?

One list is found here:

https://github.com/zellij-org/awesome-zellij

It also has tutorial links on how to write your own plugins.

I’d like to know which ones people like.


I use:

- https://github.com/dj95/zjstatus

- https://github.com/vdbulcke/ghost

And I've also defined some helper functions:

    ~ cat ~/dotfiles/custom/modules/public/zellij.zsh
    # zellij alias
    alias ze=zellij

    # zellij attach [container]
    function za() {
        zellij attach "$*"
    }

    # zellij run [command]
    function zr() {
        zellij run --name "$*" -- zsh -ic "$*"
    }

    # zellij run floating [command]
    function zrf() {
        zellij run --name "$*" --floating -- zsh -ic "$*"
    }

    # zellij edit file [file]
    function zed() {
        zellij edit "$@"
    }

    # zellij attach
    function zs() {
        sessions=$(zellij list-sessions --no-formatting | awk '{printf "\033[1;36m%-20s\033[0m %s\n", $1, $3}')
        selected_session=$(echo "$sessions" | fzf --height ${FZF_TMUX_HEIGHT:-20%} --ansi)
        if [ -n "$selected_session" ]; then
            za $selected_session | awk '{print $1}'
        fi
    }
--

I'm currently working to write a plugin which will dynamically name zellij workspaces based on their context, with an easier way to rename them as well. The automatic naming scheme is annoying to remember as it chooses two words and stitches them together, e.g "brave-piano", "lucky-iguanadon".


yeah it’s a pretty brilliant stroke. and really augurs well for future software in this brave new world of interoperability. everywhere i look there’s cool projects plugging wasm in everywhere, and it just seems like there’s enormous potential.


Last time I tried this maybe two years ago on Mac, there were some quirks/peculiarities/funkiness (can’t remember offhand what they were now a few years later), and while a liked it a lot I stopped using it because of that. Has the experience improved on the Mac or gotten ironed out since then?


It seems to be working great for me.

One thing I needed to do in iTerm2 to get some of the Alt- commands to work was to change the option keys from "Normal" to "Esc+". (Settings -> "Profiles" tab -> "Keys" sub-tab -> Click "Esc+" radio for Option Keys.


I've been using it daily for ~1 year on mac/linux and it's been pretty stable.


oh wow you sound like me, I had the exact same issue on Mac. Maybe it's been fixed?


Huge fan of Zellij. I really like the discoverability it offers. Felt really intuitive to learn, and now it’s hitting a point where navigation between Zellij and Nvim is getting on par with tmux. Can’t recommend trying it enough!


What didn't cut it for me some months ago was precisely the seamless navigation I can get in tmux and Neovim with the tmux-neovim navigator plugins. In Zellij it was no so fluid to jump between panes and Neovim. I wonder if it was solved, done differently but better with any new plugin or config.



Thank you! Will try it in the next few days!



i have no thoughts on the project (yet), as i only heard about it a couple days ago from an HN comment (funny hoe that happens), but i am pretty damn impressed by the design, tone, content, vibe, etc. from the website and docs. i don’t necessarily like every project in which i learn something interesting from the docs but it definitely does recommend it well. and was clearly designed in a systematic and coherent way by (a) systematic and coherent mind(s). lovely! will be trying it out!


Is there a mac & windows terminal that can pin tabs like this feature request? I'd love to just have all the regular connections open.

https://gitlab.com/gnachman/iterm2/-/issues/2234


I tried to use it instead of tmux and it was completely buggy and glitchy in my terminal. I have no idea why, so I gave up. Too bad because it really looked good.


I love using Zellij. Paired with xonsh is a treat.


Switched to Zellij from tmux and never looked back! Awesome job!


Zellij? Why this name?


Moroccan tiles! It’s like a tiling terminal multiplexer.


LoRa was already taken.


Still waiting for zellij to allow moving tabs


zellij 0.40.0 added support for moving tabs! https://zellij.dev/news/welcome-screen-pipes-filepicker/#rea...


A blend between Tmux, fzf, ranger, etc.


I like terminals as much as the next guy but I think terminals are obsolete. We just keep writing the same thing with the same capabilities in different languages, very little if anything is added to it.

Projects such as nushell aim to add a bit more but I think that is too conservative. Something like the jupyter or the slime/sly repl are much better. Something with a real language instead of bash and where all the little programs that make a currently terminal work are libraries that can be used as a function or as a standalone program.

Something like that would be much nicer to work with.


Terminals are not obsolete, it’s just that we try and fit too much into them.

For better or for worse, composable commands composed together with pipes is really effective. See [1] as a good example.

It’s not clear that a new “real” language would be able to have the same effectiveness if it didn’t make some of the same choices and trade-offs. Nushell (and powershell) definitely falls into the “real language without bash” category.

By this I mean: what parts of a “real” language would help with the problem linked in [1]? A imperative language would hinder this greatly, and a fully declarative one is too constraining. So you end up with a mix of both.

1. http://www.leancrew.com/all-this/2011/12/more-shell-less-egg...


> I think terminals are obsolete

But they’re not.

My colleagues and I use them every single day. My favourite shell still wasn’t written.

Besides a web browser, there simply isn’t yet as powerful a piece of software for making a computer do anything.

> Something with a real language instead of bash

sh is a real language. It’s command-based programming. An example of a more programmy variant of this paradigm is TCL (Toolkit Command Language) with its tclsh: command languages are excellent for short, frequently used stuff, and then they get worse fast.

So maybe I could qualify “real” a bit: something that is just as ergonomic for frequent stuff, but which does not get progressively worse as it veers into actual programming.

> and where all the little programs that make a currently terminal work are libraries that can be used as a function or as a standalone program.

Have you tried UNIX? It’s literally that!

I do agree it could be improved; for example, piping around structured data is not trivial; it got better with jq, but it’s not native to POSIX.


the oil shell guy is pretty ambitious. i dont really know what repl shell looks like because the shell is kind of the OG REPL, no?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: