Make tmux pretty and usable (2024) (hamvocke.com)

by speckx 279 comments 457 points
Read article View on HN

279 comments

[−] ndr 32d ago
I gave up on it once I discovered https://zellij.dev/

Just even for how tab and panes are setup, and how it's good for scrolling and text selection with your mouse for copy pasting.

[−] clintonc 32d ago

Screaming into the void, I guess, but PSA. Don't use buttons for links. In my case, I couldn't right-click and copy the URL, but there are a lot of other reasons not to do this.

[−] patates 31d ago
It also breaks a lot of a11y tooling. It really helps a lot of people when developers care about semantic html.

I personally suggest web devs to install axe devtools [0] in their dev browser profile. Also, LLMs have gotten to the point that even the small local models can help a lot [1].

[0]: https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/

[1]: Gemma 4: https://pastebin.com/Mjm1Vx4C

[−] miki123211 31d ago
Whether this should be a button or link from an A11Y perspective is... kind of up in the air.

There's an argument that links are "portals" that take you somewhere, while buttons cause some action to happen, Whether you treat a file as a resource (which your browser just chooses to save on disk instead of rendering on screen), or whether you treat it as an explicit "download" action, is a matter of semantics I guess.

[−] em-bee 30d ago
you can style a link to look like a button if you care about the difference.

but traditionally, references to files are links, and it is up to the browser what to do with them (whether to just download them or to download and then display them). that's what all links are. that's the whole point of hypertext. every link causes the browser to make a request to a server and fetch something. buttons are for activating things, not for downloading.

[−] rpastuszak 31d ago
[−] interstice 30d ago
I've often wondered.. Why _do_ people do this? For one thing it's more code than the alternative
[−] ghshephard 32d ago
The only (deal breaker for me ) weakness of zellij - doesn't support copy/paste from the keyboard (from the screen/scrollback) and doesn't support multiple copy/paste buffers.

I do that roughly every 60-90 seconds with tmux - so, until the zellij developers relent (they suggest the "proper way" of copy paste is to pipe the data into a text editor and use that - but has the downside of not supporting system copy-paste buffers.) - no options other than to stick with tmux (or fork zellij - but that seems a bit much....)

[−] evanjrowley 32d ago
Zellij has some controls for how copy/paste is handled. Perhops these could help you in the future? Link: https://zellij.dev/documentation/options.html#copy_command
[−] ghshephard 31d ago
It does - and we spent an hour or so reading through the code and affordances to see if there might be a possible path.

The general response is that this user behavior, selecting/copying/saving-in-named-buffer is a very "tmux" like usage pattern the Zellij authors don't want to encourage in Zellij. Instead -they suggesting bringing your preferred Text Editor (emacs, vim, etc...) and doing the select / copy /paste in that.

The problems for me are - (A) I know how to select/copy/paste very well in tmux. Don't have the faintest clue how it's done in a text editor, (B) No (easy) ability to have multiple named buffers if you use a text editor, etc...

I summarized them here: https://github.com/zellij-org/zellij/issues/947#issuecomment...

[−] gitaarik 31d ago
This is also the dealbreaker for me, I use copy / paste from the scrollback buffer all the time. And also quick search through the scrollback buffer. I don't want to first pipe all the output to an editor or pager or something; that messes with the terminal colors, indentation, and it's an extra step, making the whole process slower and more tedious.

But I guess Zellij people don't use the keyboard so much for copy pasting. A lot of people just use the mouse.

[−] fullstop 32d ago
I have a few embedded devices where flash space is limited. tmux is so much smaller than zellij, and it's not even close.

Zellij is close to 50 megabytes, but tmux and all dependent libraries (minus libc, it's always there) is about 2 megabytes.

[−] mokoshhydro 31d ago
Screen is only 280Kb (armv7), statically compiled with curses. That's about 6-9 times smaller compared to tmux.
[−] fullstop 30d ago
Yes, but I already require libevent and friends. The overhead, compared to "screen" was worth it, and I get split windows.
[−] rstuart4133 31d ago

> Zellij is close to 50 megabytes,

That's a Rust thing. It's what happens when you statically link because you monomorphise everything.

[−] Pay08 31d ago
And the Rust practice of everything needing at least 300 libraries. It's slowly getting to JS levels of insanity.
[−] pmarreck 31d ago
One of the reasons I went Zig for now
[−] sitzkrieg 30d ago
and this is a great example why rust will never be relevant in embedded development that actually matters
[−] senderista 32d ago
I have been using zmx for the last 2 weeks. It's still a bit buggy (screen repainting) but quite pleasant to use with ghostty.

https://github.com/neurosnap/zmx

[−] ori_b 32d ago
Once I discovered window managers and graphics, I stopped using half-baked features to emulate them in the terminal.

I use tmux to reattach to programs after the network connection dies, and not really anything else. I would welcome a version of it that stripped out everything but that, and just replayed the last few pages of scrollback on reattach.

[−] snapplebobapple 32d ago
I did the same, however, I recently switched back because zellij has just gotten too annoyingly bloated. I ended up on tmuxp to build my tmux session and autossh to keep me connected to my various ssh sessions and am much happier.
[−] hesdeadjim 32d ago
100%. Tmux didn’t click for me but Zellij did within 5 minutes. Lifelong Vim user so it felt a lot more familiar.
[−] dns_snek 32d ago
Cool, I'm one of the lucky ten thousand today. Thanks.
[−] heavyset_go 31d ago
Just use byobu, zellij does weird things, byobu just uses tmux (or screen) and has a sane mouse TUI
[−] semiinfinitely 31d ago
I tried zellij and it feels like its ui was designed by someone raised in the world of blade runner 2049
[−] LinXitoW 31d ago
Last time I tried zellij, a bunch of the default keybinds conflicted with default commands, or maybe vim commands, I can't remember. But the "solution" back then was constantly jumping in and out of "locked" mode, where no zellij keybindings except unlock work.

Didn't seem worth it, considering the giant footprint in comparison to tmux.

[−] btreecat 30d ago
Big fan of sane defaults like this.

I like tmux, but I no longer spend time customizing it for every server I run it on, only to be tripped up on some new server I haven't set-up yet.

[−] xylophile 30d ago
I love Zellij but it doesn't play well with Neovim. If you try to use both tools heavily (Neovim splits + stacked Zellij panes), your Neovim layouts will get trashed. And if I have to choose between Neovim or basically anything else, Neovim will win.

Sadly, these issues are low priority for the main dev. Instead they are focusing on things like serving terminal sessions over the web, which is useless to me if I can't use Neovim in it.

[−] kator 32d ago
I tried tmux so many times, could not commit the sequences to memory, but then zellij was just out of the gate, easy to "discover," and then I started writing plugins (rust wasm), and I even submitted a PR which got accepted to support background colors in panes/tabs.

I am a monthly donor, I think it has the right balance of community plus the lead dev has a vision, opinionated but open to inputs, and focused.

[−] xvilka 31d ago
Zellij still can't hide/show the status bar on the fly[1] and doesn't support windows preview in the windows list mode. Just these two (and many more) things are enough to stop me from migrating from tmux.

[1] https://github.com/zellij-org/zellij/issues/694

[−] llagerlof 32d ago
I used tmux for a few years, until one day I discovered Zellij. With its significantly better UI and overall user experience, I was instantly convinced.
[−] imankulov 32d ago
I left tmux for zellij after several unsuccessful attempts to get Shift+Enter working.

Was quite impressed initially and invested weeks in building new muscle memory, but somehow Zellij crashed with panic more than once, leaving all my processes orphaned. Decided to go back to tmux, and found a simple fix for my Shift+Enter issue.

In case anyone is looking for it, the fix is "bind-key -T root S-Enter send-keys C-j" borrowed from https://github.com/anthropics/claude-code/issues/6072.

[−] johnfn 32d ago
Guys, did you know about tmux control mode? It tells the host terminal to treat tmux tabs as actual tabs in the terminal. That means that things like scrollback, tab navigation, copy paste, keyboard shortcuts, etc are all handled natively, and you can visually see all your tmux tabs! It doesn't have great support across all terminals, but it does work great in iTerm 2.

Try tmux -CC in iTerm.

For a tmux novice like me, this was a total game changer :)

[−] sva_ 32d ago
For me, this is missing

    bind-key -n M-n new-window
    bind-key -n M-1 select-window -t :1
    bind-key -n M-2 select-window -t :2
    bind-key -n M-3 select-window -t :3
    bind-key -n M-4 select-window -t :4
    bind-key -n M-5 select-window -t :5
    bind-key -n M-6 select-window -t :6
    bind-key -n M-7 select-window -t :7
    bind-key -n M-8 select-window -t :8
    bind-key -n M-9 select-window -t :9
To switch around quick. So on my system I've got Super-{1-9} for workspaces, Alt-{1-9} for tmux panes.

Also if you want a vi-like copy mode (where you can select and copy stuff) that opens using Alt-/:

    bind-key -n M-/ copy-mode
    set -g status-keys vi
    set-window-option -g mode-keys vi

    # v to trigger selection
    bind-key -T copy-mode-vi v send-keys -X begin-selection
    
    # wl-copy if you use wayland
    # mouse selection in copy mode to copy
    bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "wl-copy"
    # y to copy
    bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
And btw, Ctrl-Shift-v to paste system clipboard

You can also put the config into ~/.config/tmux/tmux.conf

edit: And if you want a powerline-style design:

    set -g pane-border-style "fg=colour252"
    set -g pane-active-border-style "fg=colour25"
    set -g status-style "bg=default,fg=default"
    set -g status-left "#[fg=colour231,bg=colour25,bold] #S #[fg=colour25,bg=default,nobold]"
    set -g status-right "#[fg=colour67,bg=default]#[fg=colour231,bg=colour67] %Y-%m-%d  %H:%M #[fg=colour25,bg=colour67]#[fg=colour231,bg=colour25,bold] #h "
    setw -g window-status-format "#[fg=colour243,bg=default] #I  #W "
    setw -g window-status-current-format "#[fg=colour28,bg=default,reverse]#[fg=colour231,bg=colour28,bold,noreverse] #I  #W #[fg=colour28,bg=default,noreverse]"
Requires powerline-fonts
[−] wowczarek 31d ago
For the "pretty" argument - sure, why not, but as to changing keybinds... Well, it's like this: ^a is for screen, ^b is for tmux. You can remap everything to your taste, but you're not going to build tmux muscle memory. You're going to remember your own, erm, thing. Why does this matter? For a localhost admin it doesn't, but if you work on many systems, often either fresh or not your own, you need to be agile and you're not going to have the time or opportunity to drop your own dotfiles, plus the systems will be locked down, offline or both, and so it pays off to learn the tool at its defaults. Why nicm went for %/" I will never understand, but he did, and that's that. After screen I had X and Xpra and and Terminator at hand for nearly two decades straight and couldn't be bothered moving to tmux, and when I did, I was considering remapping it to Terminator, but I resisted, and I don't regret it. My personal config has some colours, notably different background for the active pane, a UNIX timestamp clock and mouse on and some buffer and title tweaks, but no keybind changes. But to each their own.
[−] alecsm 32d ago
I had my tmux customized to the point I forgot how to use it on a clean install which is a problem when I'm sshing into a server.

I wish it had better defaults but now I run it as is. After a while you get used to it. The only thing I always have to change is the mouse scroll and my brain cannot retain the exact command.

[−] seemaze 32d ago
I've been thoroughly impressed with tmux control mode[0] in iTerm2. This lets you manage remote terminal windows with your local window management provider. It is currently in the process of being implemented in ghostty[1] as well, can't wait!

[0] https://github.com/tmux/tmux/wiki/Control-Mode

[1] https://github.com/ghostty-org/ghostty/issues/1935#issuecomm...

[−] zzyzxd 32d ago

> Less awkward prefix keys

> Probably the most common change among tmux users is to change the prefix from the rather awkward C-b to something that’s a little more accessible.

I like the awkwardness of the default prefix key. I have almost never activated it by accident.

> Intuitive Split Commands

> Another thing I personally find quite difficult to remember is the pane splitting commands." to split vertically and % to split horizontally just doesn’t work for my brain.

This is super intuitive to me. two ' in parallel means splitting horizontally. two ° split by an almost horizontal line means splitting vertically.

> Easy Config Reloads

I reloaded config over a few hundreds of times in my first week learning tmux a decade ago. I only reloaded config once in the last 5 years if I recall correctly. It's not something you should memorize.

[−] heatmiser 32d ago
I read "tmux 2: mouse-free productivity" in a weekend years ago and it may be, pound-for-pound, one of the more impactful books on my productivity.

Seems like they are keeping up-to-date too: https://bookshop.org/p/books/tmux-3-productive-mouse-free-de...

[−] mmh0000 32d ago
I love tmux! It's perfectly usable! You only need a 400-line custom-built configuration file[1]!

[1] https://doc.xn0.org/.tmux.conf

Disclaimer: I am being silly but serious. tmux is absolutely not user-friendly out of the box. It is, however, extremely nice after an absurd amount of tweaking, which is either an endorsement or a damning, depending on your perspective.

[−] tosti 32d ago
I like having a red bar for tmux running as root and a blue one for running it as a normal user, e.g. for root:

    set -g status-style "bg=red"
I also like to have the bar on top and the status centered:

    set -g status-justify absolute-centre
    set -g status-position top
[−] yoyohello13 32d ago
If you're interested in an out of the box multiplexer. https://zellij.dev/ is great. I've been using it for about a year now and loving it.
[−] himata4113 32d ago
I highly recommend just turning the mouse on, it's amazing for resizing panels and the rightclick menu is nice.

  set -g mouse on
for multi-monitor setups

  setw -g aggressive-resize on
is also really nice.
[−] nickjj 32d ago
One nice thing about tmux is it also supports include files in its config.

This lets you put your theme colors in a different file, such as source-file "~/.config/tmux/theme.conf" and then your theme switching external script or tool can symlink a specific theme's tmux file to that path.

That's what I do in my dotfiles:

    # Main tmux config
    https://github.com/nickjj/dotfiles/blob/master/.config/tmux/tmux.conf

    # One of the theme files
    https://github.com/nickjj/dotfiles/blob/master/themes/tokyonight-moon/tmux.conf
It allows for hot-reloading different themes as well.
[−] halfwhey 32d ago
My two favorite tmux QoL improvements are enabling seamless navigation between neovim and tmux (there are many plugins but i use this one https://github.com/aserowy/tmux.nvim) and extrakto which lets you fuzzy select anything in the tmux buffer and insert into the cursor or copy it to the clipboard. (https://github.com/laktak/extrakto)
[−] colton_padden 32d ago
I prefer to hide the status bar entirely, and use an fzf-powered named window switcher to navigate between windows.

https://github.com/cmpadden/dotfiles/blob/6e767691a6b1295260...

[−] imiric 32d ago
I've used as prefix for years now. Considering how often you switch windows/panes, I reckon using a single character has saved me hours per year. :D

It rarely conflicts with whatever I'm doing, but I have a binding to temporarily switch it to C-a` and back, which I almost never use.

Oh, and I've used this themepack[1] for years as well.

Actually, here's my config[2] if someone finds it useful. I can't claim ownership of it, and probably stole it from somewhere I don't remember anymore.

BTW, the author's site https://rootloops.sh/ is certainly... something. :)

[1]: https://github.com/jimeh/tmux-themepack

[2]: https://gist.github.com/imiric/9bd3e5b7fc5e1468d05abc674f42e...

[−] hamasho 32d ago
I use c-q for prefix key because it doesn’t conflict with common zsh and vim bindings.

Because the author suggested swapping caps lock and control key, I also recommend mapping escape key at the control key and change the behavior based on whether another key is pressed. For example, if you press control + a, it sends c-a, but if you only press control key and then release, it sends escape. It makes your vim life (and in general) a lot easier. You don’t have to compete the most variable real estate on the keyboard, right next to the A key.

For most bindings like moving, resizing, and splitting,I emulate vim bindings.

Also, -r flag for bind-key command is impotent, because it enables to repeat commands like changing the pane size or move focus. You don’t have to press prefix key each time.

If you want to get fancy look with minimal setting, use plugins like nord tmux theme.

[−] strogonoff 32d ago
There’s many ways tmux could be used, but when it is part of IDE the most important usability tweaks that make tmux rock for me personally are:

— session configuration save/recall (with pane layout for each tab and directory for each pane[0]),

— nvim integration (for seamless split navigation and so that I can create or reattach to a tmux session in an nvim float, even though that nvim usually runs inside tmux),

— a bind to force-reload a pane if (when!) a command hangs.

For switching between tabs, I find that the ideal bind is simply Cmd + pane number. There’s never more than ten tabs that I’d often want to switch to within a single session. The highest number is probably four tabs. Each tab is typically assigned a high-level part of the project.

[0] I always forget what terminology a given multiplexer uses, so let’s just call them “panes” and “tabs”.

[−] Morantron 32d ago
One way to make tmux way more usable is to use tmux-fingers, which provides hint-based mouse-free copypaste capabilities

https://github.com/morantron/tmux-fingers

(disclaimer: I'm the developer of the plugin)

[−] jzer0cool 32d ago
Could never get mouse copy to work well (using mac at moment). When I make text selection, selects yellow and upon release goes to terminal prompt. I had one config work at one point and it kept selecting from all panes, not just one the one I'm in. Any ideas?
[−] thcipriani 32d ago
Ctrl-a interferes with readline shortcuts. I've been using Ctrl-: nothing, as far as I know, binds to that.

    unbind C-b
    set-option -g prefix C-Space
    bind-key C-Space send-prefix
[−] knubie 32d ago
I stopped using tmux when I started using kitty terminal with native split windows. I prefer the native window management of kitty, but I do miss the session saving of tmux (e.g. if I accidentally close a tab).
[−] yason 31d ago
Why make C-a your prefix key? Just because it's the default in 'screen'? I use C-a a lot to go to BOL, just like C-e to go to EOL. I also use C-b a lot with C-f.

The obvious choice is C-z.

You rarely suspend processes and when you do, C-zC-z is pretty quick. For other combos, it pays to have control and z close to each other so that when your little finger and ring finger operate C-z then your other fingers can freely type whatever follows the prefix without having to unwind your fingers back from the keyboard first.

[−] pavel_lishin 32d ago
Hard agree on intuitive splits, I do this as well.

My hotkey is the backtick, `, rather than a chord.

The one thing I still struggle with - because it happens rarely - is easily copying the contents, full or partial, of a particular pane.

[−] podoman 32d ago
Big fan of all of the items mentioned here. I love the "intuitive split commands" -- I'll add that.

For the vim/nvim fans out there, I try my best to add "vim-style" key bindings for navigating between panes, so that e.g. ctrl-h, ctrl-j, ctrl-k, and ctrl-l can be used to move around qukcly. My dotfiles are here:

https://github.com/jay-khatri/dotfiles/blob/main/.tmux.conf

[−] socalgal2 32d ago
I don't get it. I don't want a 1970s teletype interface in 2026 just to have persistent command line sessions.

Where's the 2026 windowed version that feels exactly like a native terminal/iTerm/ghostty app but keeps sessions alive and lets me reconnect to them, no middle man with Ctrl keys for control.

I know this post will get a lot of hate responses. I don't care. Respond by fax

[−] 1vuio0pswjnm7 32d ago
I prefer to use tmux non-interactively. For example, I use it for running daemons in the foreground, (textmode) screen scraping and scripting text-only browser

I do almost all interactive work while detached from tmux (personal preference)

I also rely on tmux buffers for a textmode "clipboard". I do not use x11

I've been using tmux since 2011 well before it became popular. I only use a fraction of its features

[−] rbanffy 32d ago
I like to have an IBM 3270 style status bar on the bottom.

    set-option -gq status-style "fg=brightblue,overline"
[−] shye 32d ago
What I don't see discussed is why tmux (and screen) are still a thing, when we have windowed desktops for 40+ years now.

Disconnecting a session's lifetime from the connection's lifetime hardly need such lengthy tutorial.

And displaying and arranging multiple virtual terminals was supposed to be the job of the terminal emulator and the windowing system.

[−] monological 32d ago
The only reason I don't use tmux is because of how annoying it is to look at scrollback. Am I using it wrong?
[−] toniantunovi 32d ago
One thing that often gets overlooked in the tmux vs. alternatives debate is that tmux's staying power is largely about ubiquity on remote servers. Zellij is great on your local machine where you control the environment, but if you're doing a lot of work via ssh on machines you don't own, tmux is almost certainly already installed. The muscle memory transfers too.

That said, I'd push back on the idea that the default tmux config is just "ugly". The real usability issue is that the keybindings are so divorced from how people intuitively think about splits and windows that even experienced users can't remember them. The visual defaults are just a symptom of the deeper problem that it was designed for someone who already had a mental model built around screen.

[−] amdivia 32d ago
My main gripe with tmux is the nested use case (tmux session on my local machine, in which I ssh to another machine, only to tmux attach within the remote machine too). Is there a terminal multiplexer/session daemon that supports nested sessions out of the box with ease?
[−] towb 31d ago
Gave up on making it pretty... But my tip is to read the manual so you know what you put in your config instead of just copy paste.

I love tmux, does exactly what I need it to do and doesn't try too hard to make the terminal a place with unicorns and fancy GUI magic.

[−] bsdz 32d ago
At some point I switched to "oh my tmux" which seems to cover most of the customisations I needed https://github.com/gpakosz/.tmux
[−] post-it 32d ago
I appreciate that tmux has theoretical advantages over screen, but man does the implementation suck. On Mac it still seems like there's no way to copy text if you have mouse mode on (at least in code-server).
[−] MarchApril 30d ago
Through many phases of using tmux, from bare bone to rocking 200-line config not counting 40 packages installed by a package manager, then back to 20 lines .tmux.conf, I'm tired. Tmux is great. Outside of control codes, I don't have any problems since tmux makes it easy to fix them. Except that I'm stuck with it while I watch a super star programmer dude switch to his 4th Konsole window to create his 21st tab and wonder how can I shave off this dependency.
[−] pythonbase 31d ago
I have used tmux, tmuxup, fzf and direnv to automate my workflow. It's pointed to the work folder, contains a project picker, invokes shell with defaults (npm run dev, python manage.py runserver etc), and fires up cursor - saving a lot of keystrokes for project initialization.

I have written about the process here: https://kashifaziz.me/blog/tmux-dev-workflow/

[−] wormius 31d ago
I gave up on Tmux due to issues w/reboot & session storage not working after.

I used the resurrect and continuum (one to save/restore, the other to save between sessions). Everytime I would reboot, the sessions no longer worked, and I'd have to delete the saved sessions.

Just trying to use Wezterms tabs panels like windows/panels. I don't do the SSH Session save/restore from remote so don't need that feature, and thus not too worried.

[−] jimbokun 32d ago
Any guides for tmux configuration that works well with Emacs? The use of Ctrl and Meta for basic operations conflicts with a lot of Emacs commands.
[−] ramon156 31d ago
I love that most tmux features are programmatic and unix-oriented.

> # reload config file (change file location to your the tmux.conf you want to use) > bind r source-file ~/.tmux.conf

Just seems fun.

That said, I still use zellij. I like the scroll info, the default bindings, and the fact it plays nicely with my setup of fish+alac. I might swap alacritty with ghostty at some point, but this works for me.

[−] mrexcess 31d ago
Rebinding C-b to C-a is a necessity for those of us whose muscle memory formed on GNU screen, been doing this for years. I like to set status-right to include host load average, with something akin to:

set -g status-right '#[fg=colour39, bg=colour234]#[fg=colour160] #h #[fg=colour088]avg: #(cat /proc/loadavg|cut -d" " -f1-3) '

[−] hugodan 32d ago
I would love to have a way to switch sessions easily, like with panes where I just click or have more shortcuts available
[−] Witty0Gore 31d ago
I run tmux inside Termux on my phone to manage a couple of long-running Node projects. It's one of those setups that sounds cursed until you realize it just works. Session persistence is the killer feature when your terminal lives on a device that might close the app at any time.
[−] sbinnee 31d ago
Though I also customize my tmux setup, the best way to use tmux is just to learn and remember the basics. Once you change the prefix bind or any other basic binds, you will have hard time on a new machine.

Btw, you can place tmux config at ~/.config/tmux/tmux.cong. No reason to clutter home dir.

[−] christiansafka 32d ago
I would also describe haventerminal.com as making tmux pretty and usable! but without any setup steps, first class support for agents, and management of multiple machines. Disclaimer: It's a macOS app we just launched and it ships its own open source session persistence.