Customizing tmux

45 EPendragon 33 8/4/2025, 3:41:30 PM evgeniipendragon.com ↗

Comments (33)

mikepurvis · 1h ago
The article is focused on interactive use, but I would be interested to also hear from folks using tmux as a process manager / dashboard for server-type environments. I was pretty unenthused about this practice when I first encountered it, but it's grown on me as a way to quickly get a sense of state from onboard a running system without having to rely on off-board dashboard or log parsers / alert systems.

In particular, I'm curious about libtmux/tmuxp and how well it works to have a more declarative bringup than just a bash script launching things into the background and then attaching tmux windows to them.

And I guess the broader question of whether this approach is an evolutionary dead end— like does it just become a pile of hacks as one discovers the need for restart policies, backoffs, ordering, whatever other stuff that is built into a "normal" process manager like systemd or runit? If you do end up wanting to send process stdout/stderr elsewhere or do alerting, is that now annoying if those streams are "trapped" in tmux sessions vs being written into log files or the journal?

kachapopopow · 1h ago
yep, that's how roughly 99.99% of major minecraft servers are ran up to this day. (and I hate migrating them)
Filligree · 28m ago
Systemd just does a poor job giving you a TTY on demand.
benrutter · 1h ago
I love tmux! Using it as a tool suddenly enabled me to do so many things. Lately I've been using Zellij, which I'd massively recommend for anyone not wanting to do a load of customisation. It just works great out the box (but probably has less wiggle room to "make your own")

https://zellij.dev/

EPendragon · 1h ago
I feel that “make your own” has been the major driver behind looking into the configs myself. Learning other configs feels like a chore. I would rather learn and make it as I go. In the end I will have a sense of complete ownership. I will know what needs to change if I decide to change it. I think investing time into making your own wins in the long run.
EPendragon · 1h ago
I will definitely check it out. Thanks for the suggestion! What would you say is different between tmux and Zellij, and why did you start using the latter?
benrutter · 20m ago
If you've used Neovim vs Helix, I'd say the comparison is pretty close.

Tmux is more customisable, but a lot messier out the box. It's much older so has picked up a little cruft along the way.

Zellij is newer so has the benefit of being a clearer implementation. But it's designed as an "out the bix" experience, not one you can customise to your hearts content.

Edit: if you did want to try out zellij, I should point out there's a "no install, try in shell" option on their website's main page which is a super quick way to get a taste!

imcritic · 1h ago
Another ex-tmux user here: for it was text selection with mouse without extra line breaks, introduced by line wrapping when long strings are rendered.
EPendragon · 1h ago
I gotta admit that the initial experience in copy mode in tmux made me cringe a lot. The fact that scrolling up scrolled through the history of the terminal's commands was the most unexpected thing. After I enabled mouse use, it became usable for me.
triyambakam · 1h ago
Setting a single key as my leader 10 years ago has been really nice. Personally it is back tick for me, but space is probably a good one too.
aaronbaugher · 11m ago
I use F2. Doesn't sound convenient, but it's just the right distance that when I reach out my middle finger hits it accurately.
hnlmorg · 4m ago
I use F2 too. I can’t even remember why I started using it. I think maybe because KDE already had a similar binding so it because my de facto control pallet binding back before control pallets were a thing.
EPendragon · 1h ago
For me, I use Spacebar as a leader key in Neovim, so I think they would conflict.

Does it ever create issues for you if you need to type the backtick in the terminal?

I found that Ctrl-A does a great job: it is conveniently located in relation to other keys that I need to interact with after I activate the prefix, and is in general easy to use.

xiaomai · 19m ago
I also use backtick for my tmux leader key. It doesn't create issues for me in the terminal (but you need to tap it twice when you want a literal backtick). This became natural for me pretty quickly.
EPendragon · 16m ago
Good to know. Thanks for the tip!
EPendragon · 18m ago
@HNModerators, I don't know why it was necessary to change the title of my post from "Customizing tmux and making it less dreadful" to "Customizing tmux". The point of the title was not the overview of all of the customization options, but the effort to make it more usable, convenient, and pleasant to use.
sjbr · 2h ago
you could also use Oh my tmux!: https://github.com/gpakosz/.tmux
EPendragon · 1h ago
I have checked it out initially. It hd a good set of defaults. I didn’t like everything that came with it, but I did read through its config file and borrowed a couple of lines from there into my own setup. IMO the problem with using a prebuilt config like that is that it requires you to learn all of its keybinds, styling, layout. I would rather build my own incrementally but have a sense of knowing everything that is going on in my setup.
aboardRat4 · 33m ago
>I felt overwhelmed by the very poor default UI that it offers and the amount of options and shortcuts that I needed to know to operate it well and be productive

Typical Macintosh user.

EPendragon · 27m ago
lol, that's likely part of the problem :D

I have started using nvim about a year ago, and that one also took three separate tries before it finally stuck with me :) After that, about 8 months ago I found tmux and had a harsh "first impression".

These days I enjoy using both of those tools and get more excited the more I learn about them.

godelski · 1h ago
So many people miss the point of tmux.

The only reason to still use tmux (or screen) is because you use remote sessions. All modern terminal emulators are already capable of doing tabs and panes (okay, maybe not sessions, but some can locally). If you're using tmux for this reason, stop. Go pick up a modern terminal like ghostty, Alacritty, or WezTerm.

But why tmux still exists today is because people are working on computers they aren't sitting in front of. Because I don't want to have to be running nohup or detaching, moving to the background, and resetting the session so error messages don't appear in my active instance. Hell, technically I can do this with vim and get something pretty similar to tmux by using the terminal. But that's a pain.

Tmux is for *terminals*

quesera · 59m ago
Using tmux locally lets me use a single interface and interaction model for multiple sessions, regardless of whether they are local, remote, or a mix of both.
kombine · 43m ago
I always find it annoying to manage nested tmux sessions so I usually use Kitty's keyboard driven tab management and tmux for server side sessions.
quesera · 5m ago
I have a status line indicator of whether tmux is in Control mode.

So, even when nested, it's always clear what will happen. One nested session (two total) is manageable. Adding another gets annoying, but the need is rare.

EPendragon · 31m ago
It is interesting to see that you use tmux and Kitty together. Is it faster or more convenient than using just one tool?
apazzolini · 59m ago
> The only reason to still use tmux (or screen) is because you use remote sessions

Do you think it's possible that someone might have a different workflow from you and tmux fits their use case in a way you haven't thought of?

godelski · 38m ago
Yes, of course. What I'm trying to communicate is that if you're just doing things locally you can get all the benefits (sin sessions) from modern terminal emulators. Most people are using panes and tabs but switching to another terminal emulator will get you these and much more. If you're using the default terminal emulator, you should probably switch (you're installing a program anyways, right?).

That said, I still use tmux. Almost every day in fact. Because all my work is being done on a machine I'm not sitting in front of. This even includes at home. My main desktop is connected to a TV for videogames and movies. When I want to do work on it there's no difference if I'm sitting in front of my laptop or it other than it sitting in my livingroom keeps it cooler and gives it better air flow.

Zizizizz · 37m ago
I use ghostty and native splits, however there is no way to move a pane to a new tab. Which you can do in tmux very easily. That's one thing I wish it could do.
EPendragon · 1h ago
For me tmux ended up being the solution for my dev needs. With a little bit of time, I learnt the ropes and became more or less productive with the default setup. Afterwards, I made it my own.

Like you mention, tmux sessions was one of the biggest features that I enjoyed about this tool: it does the job and does it well. Aside from that I love that I can use Vim-bindings with it, that it feels very similar to Neovim for me, so using them together is a no-brainer. Learning a couple of specific keyboard shortcuts is all it takes to make me productive.

I haven't needed to use a remote session yet like you note. While working with tmux locally I have learnt about all of these other features that I will definitely be looking forward to using once the opportunity arises.

I don't doubt that tools like ghostty, Alacritty, or WezTerm are great. I have heard lots about the first two. And I do intend to check them out.

What would you say is your favorite terminal and why as it relates to local development experience use? Are there features that these tools have that tmux lacks?

alfiedotwtf · 1h ago
When I was a Vim user, tmux was always the first thing I ran when connecting to a machine…

But the after moving to Emacs and using Tramp for remote sessions, followed by VS Code with its built-in session management, I never feel the need to even leave the editor let along manage sessions

valcron1000 · 39m ago
How do you deal with persistent sessions in VSCode? I have a remote VM to which I connect through SSH using VSCode, but I need to have certain programs running even after I disconnect from the VM. It's the only reason why I use tmux and I haven't been able to get rid of it.
jnpnj · 57m ago
I just found out about https://stackoverflow.com/a/52838493

    Host myhost
      Hostname host
      User user
      RequestTTY yes 
      RemoteCommand tmux new -A -s foobar
EPendragon · 34m ago
For me the value in using a tool like tmux is that it remains scriptable - startup scripts - and could be used in conjunction with other cli tools. The same applies to Vim/Neovim. Both of these tools remain unrivaled in regards to combining them with other flows and pipelines.