In case you're like me, and you wouldn't think of using a terminal without Tmux, the experimental sixel branch was finally merged[0] as of about 10 months ago. This means you can finally build mainstream Tmux with --enable-sixel and use tools like lsix in Tmux!
If you're curious if your favorite terminal or multiplexer supports sixel, you can check out the "Are We Sixel Yet"[1] site.
I switched to Zellij[1] a few years back, and I've been enjoying Sixel support since sometime in 2022. If you're looking to shake up your workflow, I find it's a vastly superior experience to tmux out of the box. It ships with all the features I would otherwise add through external plugins and convoluted configuration scripts by default while remaining significantly more stable and more performant.
My favorite feature about Zellij is the ability to have as many floating panes in arbitrary locations as desired. The way it works is that there are 2 "layers" of panes: the normal tiled panes, and a layer of floating panes that exists in front of the tiled panes. The floating layer can be toggled on and off, and the floating panes can be overlapping with each other. I have my ordered tiled panes that I work on normally, and then I can bring up my messy desktop of panes that I have lots of freedom in how I organize, more akin to an actual desk.
It's a bit silly, and certainly not necessary, but I like it a lot.
I can only second this comment. I discovered it a while back and it has been a pleasant experience ever since. I still use both though, depending on availibility.
At any given time, I'm working on like 10 different projects. tmux lets me set up sessions for each of these projects, so that when I leave one and come back in a week, all the context is there (multiple windows, bash history, working directories I was in, etc)
Since I work with big biological data, most of my work takes place on our university cluster, which means my laptop is just a dumb terminal and all of the action takes place on the server. IME, tmux is especially powerful with coupled with mosh, which gives a persistent SSH connection. That means I can be in the middle of a project, close my laptop lid, go home, then later that evening, open my lid and everything is reconnected and just right there. Same if I reboot my laptop - one command to reconnect my terminal with mosh, and I'm back in the middle of my complicated multi-window project.
Tmux provides a means multiplexing a single terminal window into multiple terminals, either full screen, or like a tiling window manager. It lets you organize and label these terminals and provides a very flexible keyboard interface to terminal management, including history scrollback, search, etc. I started using GNU Screen in the early 90s, and over the years I have developed a keyboard muscle memory for managing multiple terminals in this fashion that is completely independent from whatever terminal program I'm using. This allows me to utilize this keyboard muscle memory if I'm using iTerm2 on macOS, Windows Terminal, or Alacrity on Linux.
Many fancy terminal programs offer some subset of these multiplexing features (like tabs) and such, but in my experience none of them are as configurable or as feature rich as Tmux.
Personally I find the small shell function below really helps my tmux workflow. Run it with no arguments and you'll get a list of available sessions. Run it with a session name and it will start the session if it doesn't exist or reattach if it does. If you're already in one tmux session, it will just switch over your client to that session.
The function below will also automatically detach other clients, but for me it's what I want since other clients are always just me on another machine, often with a different screen size.
tm () {
if [ -z $1 ]
then
tmux list-sessions
return
fi
tmux detach -s $1 2> /dev/null
if [ -n "${TMUX+1}" ]
then
tmux switch-client -t $1 2> /dev/null || tmux new-session -s $1
else
tmux attach-session -t $1 2> /dev/null || tmux new-session -s $1
fi
}
Saved terminal state. Multiple tabs. Can log off and come back and everything’s there. tmux and mosh are game changers, especially while tethering/roaming and switching networks.
Anyone here who can answer this as well in the context of local work on a Mac? I manually use tmux when sshing into servers but usually that’s one session split in two and that’s it.
Locally I use iterm2 with a single hotkey window but multiple tabs with one per project and then up to 8 panes per tab. These stay open for many months until the inevitable restart for system updates. I feel like I have pretty good persistent terminals this way.
But would there be any benefit for me using tmux locally? I know that iterm2 has some kind of integration with it but I‘ve not tried that
I like tmux for keeping a remote session open but I don't use it for my local machine. On my local machine the only thing it would really buy me are tabs/split panes, and iTerm does those things natively and far better than tmux does.
Aside from tabs/panes/persistence already mentioned, it serves as a portable, programmable layer that will work anywhere, whether on the client or server side. I set up my key bindings once and now they work over SSH from Windows, local terminal emulator, on a Linux framebuffer console or even through a serial port. While I do use a tiling/tabbing window manager, tmux is just really good at what it does so I still keep using it for my terminals.
Plenty of great use cases have already been pointed out, but what I also love is that sometimes I get carried away and use the close window keybind on the wrong terminal, with tmux set to create a new session when the terminal is launched (which isn't closed unless all shells in the sessions have excited) I just use a keybind to spawn a terminal attached to any unattached sessions and never again have to recreate 10 different panes in different working directories on different windows
Also let's my colleagues monitor my builds on our shared server pretty easily and it's better than screen sharing
lots of good answers already. my tldr: it's a terminal-agnostic tool to split a window vertically or horizontally so you have multiple shell sessions on the same screen (and can move between them). Lots of other great reasons too but that's the major one IMHO.
There are many terminal users, check their email in terminal, and use browser like Links, Links2, and would like to be able to see pictures sometimes.
Also graphics response in terminal are blazing fast, and compared to whatever is happening in the Apple, MS and Gnome GUI environment that are just getting sluggish by the version upgrade. More and more I just want to do everything in terminal, and not have to deal with all this GPU acceleration BS that is happening. Give me the UI in pixels likes it is 1980's. Most of times just want to do my work, We don't care if there is some anti-aliasing or shadows under the text.
Console-based analysis over SSH is much easier when your console tools can just output charts etc directly to the terminal. Also image processing scripts are easier to write when you can directly view the images created at each stage of the process.
I'm a long time tmux user (and screen before that), but I don't understand why sixel makes a difference.
Is this as big as bring a stacking window manager to tmux (compared to the current which is tiling)? Or is just better graphics in the terminal? or am I way off here?
If it's just the better graphics, then I'm not sure I understand why tmux needs to support it. I would think the terminal emulator (such as Gnome terminal) is what would matter. I suppose maybe both but I would think tmux would just pass through.
Terminals and shells aren't like window managers where you can just subdivide your drawing space and pass a block pixels to something else to draw on.
What the terminal processes processing is a stream of bytes from the shell and needs to be able to interpret them in order to lay things out correctly.
It doesn't. If you run brew edit tmux and add args << "--enable-sixel" after line 76 and then run brew uninstall tmux and
brew install --build-from-source tmux, you'll get one where it is.
> I think my favourite feature of this repo is the `README.md.d` directory.
The real power move here would be to embed the images as verbatim sixel inside the README file. Thus you could cat README and see them in all their glory.
$ lsix
Error: Your terminal does not report having sixel graphics support.
Please use a sixel capable terminal, such as xterm -ti vt340, or
ask your terminal manufacturer to add sixel support.
You may test your terminal by viewing a single image, like so:
convert foo.jpg -geometry 800x480 sixel:-
If your terminal actually does support sixel, please file a bug
report at http://github.com/hackerb9/lsix/issues
Please mention device attribute codes: ^[[?6c
Too bad! That would be pretty spiffy.
Is there an open-source windows terminal which supports Sixel? Mostly seems only Cygwin or WSL stuff out there, nothing pure?
I don't really like that they're including so much non-core functionality. Why should a terminal emulator provide its own multiplexer, ssh client and serial connection libraries, instead of using those already available on the operating system?
iTerm2 for MacOS has similar functionality baked in, but less demanding on the server side.
Rather than using a ton of server-side image libraries to render the picture into sixels on the server, it just sends a base64-encoded copy of the whole image to the client where it can determine the image type and render it into the terminal locally.
konsole implemented the same protocol; I use their unmodified imgcat script on Linux. It's of course much faster than converting using imagemagick, still added lsix to my bin directory for now. :)
Be careful running this on an untrusted directory, especially with e.g. pdfs, just like anything else that parses images, especially using ImageMagick.
Is parsing untrusted images inherently problematic?
If I open my (untrusted) downloads folder using Gnome Files and it displays (and therefore parses) the contained images, is that a security issue I should be concerned about?
(I would have assumed that (e.g.) Javascript in PDFs could be problematic, but not a simple preview.)
If you're curious if your favorite terminal or multiplexer supports sixel, you can check out the "Are We Sixel Yet"[1] site.
[0]: https://github.com/tmux/tmux/commit/dfbc6b1888c110cf0ade66f2...
[1]: https://www.arewesixelyet.com
[1] https://zellij.dev/
It's a bit silly, and certainly not necessary, but I like it a lot.
Since I work with big biological data, most of my work takes place on our university cluster, which means my laptop is just a dumb terminal and all of the action takes place on the server. IME, tmux is especially powerful with coupled with mosh, which gives a persistent SSH connection. That means I can be in the middle of a project, close my laptop lid, go home, then later that evening, open my lid and everything is reconnected and just right there. Same if I reboot my laptop - one command to reconnect my terminal with mosh, and I'm back in the middle of my complicated multi-window project.
Many fancy terminal programs offer some subset of these multiplexing features (like tabs) and such, but in my experience none of them are as configurable or as feature rich as Tmux.
The function below will also automatically detach other clients, but for me it's what I want since other clients are always just me on another machine, often with a different screen size.
Locally I use iterm2 with a single hotkey window but multiple tabs with one per project and then up to 8 panes per tab. These stay open for many months until the inevitable restart for system updates. I feel like I have pretty good persistent terminals this way.
But would there be any benefit for me using tmux locally? I know that iterm2 has some kind of integration with it but I‘ve not tried that
It does a good job at scaling the session to fit the size of each client's terminal window and has multiple scaling options available.
In my experience it works way better than for instance terminal sharing in VS Code.
Also let's my colleagues monitor my builds on our shared server pretty easily and it's better than screen sharing
Deleted Comment
Also graphics response in terminal are blazing fast, and compared to whatever is happening in the Apple, MS and Gnome GUI environment that are just getting sluggish by the version upgrade. More and more I just want to do everything in terminal, and not have to deal with all this GPU acceleration BS that is happening. Give me the UI in pixels likes it is 1980's. Most of times just want to do my work, We don't care if there is some anti-aliasing or shadows under the text.
Is this as big as bring a stacking window manager to tmux (compared to the current which is tiling)? Or is just better graphics in the terminal? or am I way off here?
If it's just the better graphics, then I'm not sure I understand why tmux needs to support it. I would think the terminal emulator (such as Gnome terminal) is what would matter. I suppose maybe both but I would think tmux would just pass through.
Tmux needs to know that there are graphics on the screen and redraw in any of those situations.
What the terminal processes processing is a stream of bytes from the shell and needs to be able to interpret them in order to lay things out correctly.
The real power move here would be to embed the images as verbatim sixel inside the README file. Thus you could cat README and see them in all their glory.
https://github.com/hackerb9/lsix/blob/3a431793a747df3f934051...
"\e[c" is "send device attributes":
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-F...
Is there an open-source windows terminal which supports Sixel? Mostly seems only Cygwin or WSL stuff out there, nothing pure?
https://github.com/wez/wezterm
https://github.com/hackerb9/lsix/issues/69
Rather than using a ton of server-side image libraries to render the picture into sixels on the server, it just sends a base64-encoded copy of the whole image to the client where it can determine the image type and render it into the terminal locally.
https://iterm2.com/documentation-images.html
If I open my (untrusted) downloads folder using Gnome Files and it displays (and therefore parses) the contained images, is that a security issue I should be concerned about?
(I would have assumed that (e.g.) Javascript in PDFs could be problematic, but not a simple preview.)
https://github.blog/2023-10-09-coordinated-disclosure-1-clic...
0: https://www.cvedetails.com/vulnerability-list/vendor_id-7294...
https://github.com/dheera/python-termgraphics
Might be interesting to mod this library to support this as a fallback.