Zellij – A Terminal Workspace and Multiplexer
zellij.dev
zellij.dev
The first thing I noticed is that this interface is discoverable - it shows me what I can do, which is incredible and makes me want to use it. The main reason I've been a casual tmux user and not an advanced one despite using it for years, is because every time I want to try something new I have to google if it's possible.
The second thing I noticed is that it uses ctrl-r as a core shortcut. Mega problem: ctrl-r is a built-in bash feature which I use every day to recall previous commands. This makes me think I can't use this tool at all.
I would suggest to consider taking a page from tmux's book. Just use a global modifier key. Ctrl-b is what tmux uses, so you know it's safe. Other software being developed knows they should avoid it, because tmux uses it. By also using it, you'd no longer have to dance around the global space of what shortcuts every software in existence is using. Additionally, if you use ctrl-b to enable your commands, you can minimize your interface. Currently you're using two entire lines to display your menu. That's going to become tiring as I use zellij 8 hours a day for years. I'll have to hide it eventually. Instead, what if you reduced it to zero lines? Put "ctrl-b: menu" in the upper right of your title bar. Pressing ctrl-b now enables commands and shows what your next keypress will do. You have now (1) avoided breaking existing shortcuts, (2) aligned with established standards (3) given some familiarity to welcome tmux users (4) expanded visible screen space and (5) simplified your menu system. You can also now remove ctrl-g since the interface is "locked" by default until I want to start interacting with it.
Anyway that's my 2 cents. Thanks for this exciting demo.
In fairness, ctrl-a (screen default) and ctrl-b (tmux default) are also super useful readline shortcuts in bash (c-a = go to beginning of line, c-b = back one character).
EDIT: Sorry, I just realized - ctrl-r isn't a prefix, it's a shortcut, isn't it? And they have lots more? Yeah, that's ... a pretty questionable approach; it'll interfere with lots of things.
Ctrl-b is "back one character" in most apps that use readline (including bash) and emacs.
For that reason I change my Tmux prefix to Ctrl+Y (I also think it is more ergonomic).
I switched my .screenrc to use ^O as the escape key; in vim insert mode it's "take the next keystroke(s) from the normal mode keymap" so you can `^O d t $` from insert mode to delete up the end of the line or whatever. I never use that in vim. I don't even remember what exactly it does in emacs, something that inserts a newline. In readline I think it's "accept-and-...something-else", that I also never use.
I usually run a single actual terminal, running a "meta" screen session, with one sub-screen session for each project or environment. The outer screen uses ^Z as the escape key because I hardly ever use this for she'll job control (I have ~infinity screen windows, after all).
There's no way to please everyone :-)
The idea was that users should spend most of their time in "normal" mode, deferring to "locked" mode only for cases like you mentioned (ctrl-r in bash or in vim). The modal ergonomics are built on that.
I'd ideally like to find one word that describes locked mode better than "locked", which I agree is not ideal. I spent quite some time thinking about it and asking others, but most of us are not native English speakers - so maybe there's something obvious we're missing. :)
But if it is easy to change then I think it is OK.
One of the first things I do on a new system with tmux is remap CTRL+B to CTRL+A, as a screen hangover and I think it is more ergonomic anyway.
Though it means I've completely given up using CTRL+A / CTRL-X for incrementing / decrementing numbers in vim.
I can't think of any programs that have an important use for CTRL-B, that's the tradeoff between uniqueness and usability I guess.
I don't think there will be a choice to keep everyone happy or that is totally conflict free.
> Build a web client to allow users to connect to a running Zellij daemon through the browser (on a local or remote server).
That's the future feature I'm most interested in over TMUX.
You could quite easily configure Zellij's keybindings [0] to mirror your tmux config.
Looks like it'll be coming relatively soon (there's already a PR open, although it needs some refinement)
The main thing which I was afraid of was the same as you've said - that I won't be able to change my muscle memory. Another thing - I won't be able to switch back the old keyboard (I expected to use it at the office) or even won't be able to use laptop keyboard anymore.
Surprisingly even after getting comfortable with Ergodox with totally different layout (different firmware is being used between keebs) I'm still able to jump between those easily. Maybe the first 5 mins are a bit harder but that is it. This surprises me what human brain is capable to do. Of course I still need to switch between keyboards regularly to not forget the layouts.
Not the same thing but we often are afraid of unknown.
I assume you can customize your keybindings so that they're mostly the same as your TMUX configuration.
But even if you couldn't, based on my own experience changing editors/OS/other tools, if you commit to it, retraining should take a couple weeks at most. It'll be super annoying for that couple weeks but it's really not all that ingrained.
So far I've solved that problem with keyboard shortcuts or other macros to pull up a terminal when I need it.
Using Lynx in the terminal might be another way to do it.
Am I misreading their blog post?
A) download a terminal emulator + ssh application onto their computer & run that, flooding the screen with some unknown terminal application.
B) opening a web page & logging in to a Zellij or TermKit or whatever session.
Which do you think will seem more baroque to them? The web is an obvious, much improved way to do almost all software. It's online, universally accessible. A lot of stuck, old-fashioned-thinking in this thread. I'm a ssh + tmux (or more often ssh + dtach/vim) user myself, but it's clear to me this has serious disadvantages, that it's not nearly as accessible, as on tap as it could be.
I think more projects will start following the same direction soon!
"Fast & Safe. Wasmer runs WebAssembly at near-native speed in a fully sandboxed environment." (https://github.com/wasmerio/wasmer)
But ...
"Cranelift does not yet perform mitigations for Specter or related security issues, though it may do so in the future." (https://github.com/bytecodealliance/wasmtime/tree/main/crane...)
Will the wasmer runtime handle specter / meltdown / rowhammer attacks?
This is still not a complete security story and would not provide the same kind of protection as a VM, but I think the charitable take here is that this is a good sandboxing tool and a step in the right direction for something like a plugin system.
edit: I also disagree with the "fully sandboxed" wasmer line, but wasmer is a venture-backed for-profit org that will start selling something at some point and they might have a motivation to blur the lines a little. I appreciate cranelift's more honest disclaimer.
Zellij seems to be using WASI, a standard set of syscalls. Currently, wasi syscalls (or at least the version of wasi that is running in wasmer) can't really access the network, can't fork/exec, can provide a chroot view of the filesystems (without root access), can limit access to certain types of functionality. These kind of secure defaults seem like an improvement to me compared to most plugin systems I'm familiar with.
Maybe vimscript/emacs-lisp has these things.
But it seems you should not use wasmer for running untrusted code or binaries.
I also don't know enough about rowhammer, or security exploit of any kind really, to answer the question about how you could use them against a terminal multiplexer.
Also, seccomp only works in the Linux kernel (not in Windows, or macOS)... so it's a no-go for a universal sandboxed VM :)
What I really liked: I didn't have to read any documentation to understand how to do the things I'm used to in tmux, the CTRL+[KEY] menus with hints are really helpful and well designed.
What I didn't like so much: The interface doesn't feel as snappy as tmux over a remote connection, and I couldn't find any way in the "CTRL-menu" to detach (like tmux CTRL+B,D)
Looking forward to future releases!
I remember good old pure text-mode days with warmth but doubt there are many people actually doing it nowadays. So I imagine this (thesubject) is going to be ran inside a GUI terminal emulator window and I don't understand how is that better than just having more windows.
I'm pretty happy running full text mode editing in emacs (-nw, ftw :) and a few other shells for tasks I haven't incorporated into emacs yet. Speed is nice, even over a vpn, which running anything graphical is somewhat grim.
Still, the killer feature with screen multiplexers (in my case, tmux, but this isn't unique to tmux) for me is the fact that the tools preserve state, so I can start a long job and it won't be interrupted, even if the connection drops. I just log back in and reattach and everything is just like it was.
Sure there are other ways to do that, but having it neatly wrapped up and always on is really a game-changer for me.
It's immensely a cleaner solution than toying around with separate windows for me. Switching sessions and consoles is seamless and it's all in one window. Eventually something will bite me regarding Tmux getting in the way of something and causing headaches but the momentum I have is great.
I suggest trying one out sometime, it may open a whole new world of tooling for you! Otherwise there's no sweat if you got something working sans multiplexer.
I don't want to tile all my windows, only terminals, so I'm not interested in tiling WM.
I also jump between OSs and appreciate being able to have the same terminal multiplexing behaviour on both linux and macOS, without needing to learn the keyboard shortcuts and idiosyncrasies of two different GUI terminal multiplexers.
As another commenter pointed out, being able to multiplex in the exact same way for remote sessions is a massive bonus.
Lastly, tmux has a lot of features and customization and once you learn those you really come to appreciate them. Tmux can also look really quite nice, it doesn't need to look as boring as it does out of the box: https://i.imgur.com/MgUx0U2.png.
I use tmux almost as much as bash. And if you use a Mac with Iterm2, you can use tmux the way you're imagining.
The primary advantage is the same reason I still use vim a lot - speed and efficiency. There is just no comparison to GUI tooling. But I readily admit a lot of it is familiarity - I know and like my tools, and there's no advantage gained by changing.
I have a single window that is all of my terminals - which to me is much easier to manage than a load of random terminals all over the place. Sessions are named, and windows are named, and I have F1-F8 mapped to load the corresponding window, F10 brings up a list of sessions, and F9 toggles between the last 2 sessions.
Mine is based on https://github.com/gpakosz/.tmux but customised for F keys, status bar, mouse etc
Tmux is the UI for switching between ssh sessions sharing the connection.
Locally, I don't bother and just use i3.
I guess you can hit enter before every command is entered to get the correct time but that is a lot of wasted space!
Maybe I'm getting too minimalist but I don't see the benefit to productivity in these over the top prompts.
If anyone is curious what it looks like: https://imgur.com/Xx19sFn.png
/s heavy tmux user that left it for xmonad.
The only terminal emulator that supports selection with keyboard afaik is rxvt with plugins. I would be interested to know if there are other terminals that support this. Please don't say emacs XD
Run rxvt if you like.
I use a multiplexer because it lets me instantly open a new terminal in the same directory I'm currently working in. Furthermore it can open the terminal's buffer in Vim, letting me select and copy text using all features and shortcuts I'm used to. Doing the same by scrolling around, selecting snippets using the mouse and pressing Ctrl-Shift-C cannot compete with that.
Yes, there are a few terminal emulators with integrated tabs and window splitting and all that which offer similar features, but then they also have countless other things I don't need and in return take ten times longer to open a new window.
You can add a keybinding for this with alacritty:
{ key: N, mods: Command, action: SpawnNewInstance }
> Furthermore it can open the terminal's buffer in Vim, letting me select and copy text using all features and shortcuts I'm used toalacritty has vi mode which gives you all of those keybindings without having to open vim (ctrl+shift+space).
It doesn't give me access to my custom keybindings or the plugins I have setup in Vim. Also I can't select or annotate terminal output and then save it directly into a file in one step.
The multiplexer is both more powerful and flexible by actually doing less and just passing tasks like selection and copying to other proven tools. I appreciate that more than terminals trying to do everything.
It's been reduced to merely being a replacement for screen for me.
* mtm: https://github.com/deadpixi/mtm
* dvtm: https://linuxconfig.org/an-introduction-to-terminal-multiple...
* abduco
None of these have ever stuck with me because I don't like how they alter the ability to scroll (although I haven't tried the newer tmux mouse/scrolling capabilities).
To maintain a session I prefer to use EternalTerminal (screen messes up scrolling much like tmux).
I find most of my windowing needs satisfied by tabs in the terminal and by using Xmonad on Linux or yabi on Mac whereas some Mac users seem to be at least partially making up for the lack of window management with tmux.
I just switched to using wezterm as my daily terminal. It is written in Rust, very fast, featureful, and works cross platform.
Rearranging a layout with more than 3 panes in tmux or vim is always difficult. In tmux it's at least easy to swap panes (C-prefix '{' or '}'), but vim doesn't have any simple way to do something similar. I wonder if Zellij's approach makes it any easier. Maybe it's a UX pattern that is made easier with a mouse.
I switched to st because Alacritty still has no ligature support, but aside from that limitation it's definitely my favorite.
Unfortunately it doesn't implement the feature that keeps me stuck on Terminator: disabling of line wrapping. After using that I could never use a different terminal. But perhaps this could inspire me to try and learn enough Rust to implement it :-)
Lets you predefine layouts and what will run in each pane.
What’s the state of the art for managing the running of, and the output from, multiple CLI commands at once? Say I have a task D that requires a task A, B, and C, but for which A and B and independent.
The naive solution (let the output interlace and just watch the exit codes) creates a substantial comprehension problem for my coworkers, so I don’t usually do it. But over and over again I find myself having a 20-90 second inefficiency or two caused by running two tasks that have to complete but the order doesn’t matter.
Thought I would take a look at this. Like the presentation of all the actions. TAB control was nice and all that.
But what is with the crazy input character delay? Not much fun for touch typing when I can get ahead of the input buffer by four or five keys (without really trying). I have never noticed that on tmux.
Is anyone else seeing this?
The reason I ask is that while I never used a multiplexer like tmux, I use the layout features of kiTTY every day and I can't quite see beyond that common use case (split this terminal into X windows with Y layouts).
Seems muxers are essential for more ops / infrastructure facing workloads
As a side note, does anyone know why it fails to load the separators in the status bar on WSL? I've got a proper font installed and even emojis work. However with Zellij, I am just getting "" characters between the Ctrl + lines.
It seems Zellij somehow makes the order of the splits irrelevant.
In my experience, true color support, Unicode width and RTL language are very problematic.
I have a bash script by the name of .tmux inside of every workspace folder. Its contents are typically a single multiline tmux command that creates a new tmux session with all the screens and processes relevant to the project (usually: emacs, shell for git, ssh to staging + prod, prompts in various databases, and several entr-driven screens for automatically running migrations, tests, etc).
Separately, I have a shell function that runs every time I change directories that checks for the existence of said file, and then either runs the file, attaches to the existing tmux session associated with the folder, or does nothing (in the case that the shell is already in a tmux session).
In short, I setup my workspace once per project.
edit: After running "rustup update" it does install. I am liking Zellij so far.
Rust devs, please don't. Not every Rust developer uses rustup or knows how to solve this issue, not everyone is willing or able to use the nightly build just so dependency 21/63 doesn't throw errors.
After doing rustup update now it installs correctly. Thank you.
Take a leaf out of Rust's book and use something simple and sane like TOML, YAML is a mess.
See: https://github.com/cblp/yaml-sucks
Otherwise this looks like a great project, please don't ruin it with YAML.
There are no good configuration languages in existence and there never will be. We have rejected Lisp/sexp so now we must suffer endlessly.
It has exactly five data types, each with very clear and distinct notation that nests consistently (the top level isn't somehow "special" and there's no messing with significant whitespace). Only two collection types: keyed, and unkeyed. In some sense it feels like the apotheosis of untyped data-modeling.
https://thedailywtf.com/articles/the-inner-json-effect
“Tell us what you did to JDSL,” one of the VP’s asked.
“I don’t think I did anything,” Jake answered. “I’ve only been here two weeks, trying to learn JDSL and how the customer portal works. I don’t even know how to deploy it!”
“You made a few commits to Subversion!” Tom shouted.
“Well, yes. I added a few code comments, trying to–”
“You can’t use comments in JDSL!” Tom shouted. “THAT’S WHAT BROKE IT!!”
JSON5 is probably the best option at the moment.
* Instantly obvious what the structure is (unlike YAML or TOML).
* Everyone knows JSON already. This just makes it a bit nicer.
* No noob security mistakes or type confusion caused by underquoting like YAML.
JSON is close to sexps, but it sucks when comments are not allowed.
[1] https://github.com/cuelang/cue/tree/master/doc/tutorial/basi...
So, the project you linked to is Java / Scala: https://github.com/lightbend/config
And there're also (basic? complete?) HOCON parsers in Javascript and Rust — I investigated this a while ago, because I want to use HOCON everywhere in my projects:
https://docs.rs/hocon/0.5.1/hocon/ (Rust)
https://www.google.com/search?q=hocon+javascript (Js, a few different)
The Rust version:
> This implementation goal is to be as permissive as possible, returning a valid document with all errors wrapped in `Hocon::BadValue` when a correct value cannot be computed
How nice :- ) (it seems to me)
That definitely seems like a solvable problem though.
This is absolutely true. Another recent high profile example I can think of is HCL with terraform.
> YAML though is always a bad fit. If you want machine readable config, use JSON; human readable, use TOML. When does YAML ever fit?
If replacing JSON is the objective, I'd very much rather recommend HJSON [1] than TOML.
But there is also JSON5, among the most popular alternatives. Then HOCON you mention, and probably a myriad more.
This is just plain wrong. It supports exactly the same kind of nesting as JSON.
YAML, TOML, Lisp, Dhall, JSON, EDN, JSON5, HOCON, Lua, HCL, XML, HJSON, Starlark, strict yaml
About a third of which I'd never heard of. And because I can't help myself (the dogpile is so enticing!), I have to say that the one that I'm most interested in is: Dhall.
e: And, AFAIK, I believe the latest YAML 1.2 spec (from 2009) has addressed these issues.
It's possible to avoid these pitfalls - like people do with PHP - but why burden users with that in a new project when better options have been available for years?
They obviously like Rust, why not just follow their lead with TOML?
Parser implementations have also been buggy. The ruby one in particular being a source of RCE's. Of course, these are implementation issues, but surely a simpler specofication would be easier to implement. And the current specification is anything but simple, clocking 84 pages in the PDF flavour.
It's a language that coerces basic strings...
A bigger problem is that so many things are using config files that should be proper DSLs or libraries, but no one wants to maintain a library (or create RCE as a service by accident) and no one wants to write a parser/interpreter.
Most of the "YAML sucks" issues would go away if we stopped treating LowCode as something desirable (we do actually need to write code sometimes, as it happens) and if we had better sandboxing/parser generators along with less animosity towards DSLs.
People do unholy things with it like nest bash scripts in it that should never be done. Text files should never have more than one syntax needing parsing. It's bad enough, say, embedding SQL into some python. But doing that with YAML is just the worst.
You should be able to use regexes to deal with non-code text files. JSON, YAML, the whole motley crew require parsing. Don't get me started on JSON log files.
> Futile investment of time and energy in discussion of marginal technical issues
I don't see how the choice of configuration file format is a marginal technical issue. It makes a big difference to the ergonomics of a tool.
It's one of the things I like most about Rust over my main programming language Kotlin. Rust has Cargo which uses TOML, which is nice and simple. It's so much more pleasant to use than Koltin's Gradle.
Rust is a fantastic language, but it's probably not the kind of language you want for this purpose. Same reason why game engines often have scripting languages; so people don't have to deal with C++ where it's not required for performance.
Imho the best compromise is embedding something like Lua which is simple and still flexible enough to allow more than JSON-style declarations.
>compile AOT to a JSON file and build everything deterministically from there
you want the dev that develops zellij to AOT compile all settings (that they set using rust as you imagine) to a JSON file that is then... what by end users? inspected but not edited? how would settings change then?
So much debate could have been avoided if we stuck with S-Expressions from the beginning.
Was hopeful this would leverage TOML as it's built using rust.
Shouldn't that be completely opaque to the user? I don't have any idea what programming language most of the software I use is written in.
If it's faster or more stable than tmux, shouldn't that be what's advertised, rather than implementation details? Reading the page, what catches my eye is the webasm plugin system (although it's not immediately obvious to me what I'd use that for).
No necessarely, because app being written in Rust and Go is actually a feature for the user, it means the entire app is a single executable with a decent runtime performance.
I do still question what it means if the coolest thing to say about it is it was written in Rust, whether that's intended for developers or for users
That would have been nice indeed. However many languages use lots of memory and are a bit slow, or are security-dangerous like C. It's nice to know, then, that this app likely uses barely any memory at all, and is as fast & keyboard-responsive as it can be, and harder to hack — Rust. (Assuming it is implemented in a good way :- ))
If it's more secure, that's harder to measure. But that's not even the tagline, just that it's written in Rust.
— that's easy to measure, if it's written in C or not (or some other memory unsafe language)