This is written for the Linux-on-the-Desktop crowd, and good for them. But tmux really shines for folks using MacBooks with iTerm2. Its tmux integration is so good that it simply disappears into my workflow.
With this in my `~/.ssh/config`, I can just type `ssh tmux` to get back to my remote dev box whenever I wake my computer or change connections.
Host tmux
HostName 1.2.3.4
IdentityFile ~/.ssh/etc.etc.etc
RequestTTY force
RemoteCommand tmux -CC new -A -s 0
With iTerm2's tmux integration enabled, this will pop open a new window where the remote tmux tabs and scroll buffer look and act just like native, local iTerm2 tabs and scroll buffer. I don't even know any tmux commands.
mike-cardwell · 7h ago
I use a combination of mosh and screen for this. I only need to type something to get my session back, after a reboot. Changing networks or putting my laptop to sleep for days doesn't drop my sessions: https://www.grepular.com/Immortal_SSH_Sessions
ghkbrew · 39m ago
Mosh looks very cool, though I've never used it. Does Screen provide some advantage over tmux in this setup?
scelerat · 3h ago
I ran into so many little annoying color and font issues with vim, tmux and iTerm2 that I gave up on tmux (for local work). What small benefit I got from tmux on my local machine (basically surviving updates and a little more session persistence) I rarely miss.
I wanted it to be better, and might go back if I could figure out the font issues, but I just don't have the time right now.
suslik · 7h ago
Wow, I've tried tmux like a hundred times and could never learn to like it, falling back to screen and promising to myself - never again. I'm going to break my promise to try this.
fouc · 1h ago
I've always found screen's ctrl-a is so much easier to reach for than tmux's ctrl-b. I recommend re-mapping ctrl-b to ctrl-a
_kst_ · 38m ago
I use Ctrl-Space.
unbind-key C-b
set -g prefix C-Space
bind-key C-Space send-prefix
I find it a lot easier to type than either Ctrl-A or Ctrl-B.
Does any Linux terminal have a comparable integration? I'm still using GNU Screen but willing to give tmux another shot.
felixding · 2h ago
WezTerm
The author of this feature also ported it to the Windows Terminal.
Besides, Chrome OS’s built in terminal also has tmux integration.
natebc · 1h ago
Do you have links to any examples? I've searched for this on and off for years, and i use Wezterm, but i've never been able to make it work like i remember the iTerm2 integration working.
Would love for examples using Windows Terminal as well.
ho_schi · 35m ago
I use happily GNU Screen. Keep it?
edoceo · 2h ago
There was one called Terminator which had some tmux like features, split panes, broadcast, etc. It's not been maintained in a bit.
Pretty sure iTerm is the only term that implements that tmux protocol.
tristan957 · 1m ago
Ghostty has infrastructure to support it from my understanding, like Mitchell did the initial plumbing. It just takes a spirited individual to finish it up.
op00to · 2h ago
Would mosh stop you from having to reconnect to SSH at least after wake? You'd still need to reestablish a mosh connection after rebooting.
paradox460 · 1h ago
Tmux cc mode doesn't work over mosh. Something to do with how it mangles binary going over the wire. Breaks other iTerm2 features like local copy paste from remote paste boards, drag and drop uploaf and download
crtasm · 7h ago
Then a nice addition is to save typing it each time
alias looptmux='while true; do ssh tmux; sleep 2; done'
nolist_policy · 3h ago
Better:
autossh -M0 tmux
bitbasher · 1h ago
This blog post reminds me of _why_ I use tmux. Did you see how much they needed to do to even resemble the workflow of tmux? Jeez, just use tmux. I don't mind dealing with wonky copy and paste once in a while.
> In summary: multiplexers add unnecessary overhead, suffer from a complexity cascade, because they actually have to translate escape codes, modifying them in hackish ways to get them to work with their concepts of windows/sessions.
What does that have to do with you using tmux? You're not the one maintaining tmux's codebase.
Skunkleton · 38m ago
> I don't mind dealing with wonky copy and paste once in a while.
This problem is in no way unique to tmux. You have the same problem with any terminal app that takes over drawing, eg vim. That said it is also easy enough to fix.
The solution is OSC52, a terminal escape sequence that the emulator can use to interact with the system clipboard (kitty, alacritty, iterm2 all support this). The first step is to get you a script that writes out data in that protocol. Its easy enough:
#!/usr/bin/env python3
import os, base64, sys
clip = base64.b64encode(sys.stdin.buffer.read())
for pid in (os.getpid(), os.getppid()): # so that osc52-copy can be invoked by processes that themselves do not have a tty.
cty = f"/proc/{pid}/fd/1"
try:
fd = os.open(cty, os.O_WRONLY)
if os.isatty(fd):
os.write(fd, b'\x1b]52;c;') # the actual escape sequence
os.write(fd, clip)
os.write(fd, b'\a')
break
except:
continue
finally:
os.close(fd)
else:
raise SystemExit(f"no tty")
Now you can do this:
$ grep my_thing < some.txt | osc52-copy
And whatever got into osc52 is now on your system clipboard.
Tmux (set -g clipboard on) and nvim (unset clipboard) both have native osc52 support, and the script above can be used to integrate other places.
udev4096 · 34m ago
I am tired of seeing people creating problems out of nowhere. The reasons author gave are stupid and I am gonna question his "7+ years" of tmux usage
d4rkp4ttern · 7h ago
I learned about Tmux just a few weeks ago and found out that one of the nifty features is that it is scriptable, I.e allows programmatically sending keystrokes to a specific pane. Then, inspired by some Japanese forums I asked myself if I can leverage this to have Claude Code actually interact with an interactive CLI script — we know CC can launch a script via bash but if said script waits for user input then CC can’t (easily) interact with it. Turns out yes we can leverage Tmux for this!
So I used Claude Code to build a little el tool called Tmux-cli, which gives a convenient way to have CC (or any CLI coding agent for that matter) spawn a Tmux
Pane, launch a script there, and actually interact with it.
So it’s like Playwright/Puppeteer for the terminal.
There are some interesting possibilities this enables:
Let CC autonomously test interactive CLI scripts, without me having to intervene and point out errors.
Have the CLI coding agent launch UI from another pane and then use Puppeteer MCP to test from a browser.
Let CC launch a cli script with a debugger enabled (e.g. Pdb) and set breakpoints etc — for token-efficient code understanding, debugging and explaining.
Let the CLI coding agent spawn and drive another instance of the same or other CLI coding agent, AND interact with it. Note this is way better than CC sub-agents which are “spawn and let go” black-boxes.
I wonder if the discussed Tmux alternatives enable building this type of tool.
Izkata · 4h ago
> and found out that one of the nifty features is that it is scriptable, I.e allows programmatically sending keystrokes to a specific pane
In case anyone was curious, screen can do this too with the command "stuff" (read it as the verb like "stuffing something into a box").
Sherveen · 7h ago
Yup, another fun thing to do w/ this: let Claude Code talk to and control Gemini CLI, OpenCode, other CC instances, etc. in interactive mode! A different flavor of subagent. :)
d4rkp4ttern · 7h ago
Indeed, or vice versa where we leverage Gemini’s monster context length
I'm reviewing the docs and interested in the scripting. I like that it uses python to script.
Could I have kitty send each line it receives to an external tool, say via HTTP?
I want to make a custom frontend to claude code, or any other CLI tool, and an obvious easy frontend is a web tool that communicates over HTTP, so getting claude wrapped in a HTTP control system seems like a good starting point.
I'm interested in whether things like "tmux capture-pane" which strips characters come from Kitty as well? Do I need to be cautious of control characters?
wild_egg · 5h ago
Do you find the tmux-cli wrapper to improve results?
I tell Claude to use the existing tmux CLI to send-keys, capture-pane, etc. and it works flawlessly. Literally just "never use the Bash tool, run all commands in tmux sessions" and it knows what to do from there.
d4rkp4ttern · 3h ago
One other thing I found is that when it spawns another Claude in a pane, and sends it a message, the enter key doesn’t register if sent immediately, so the other Claude doesn’t act on it. So in Tmux-cli I added a delay after experimenting with various values. I guess with plain Tmux it might run into this issue.
d4rkp4ttern · 3h ago
This is nice to know. I didn’t compare with plain Tmux but should. In Tmux-cli I set up some convenience functions and scaffolding to prevent accidentally killing itself etc. But yes if plain Tmux works well I would just use that; it’s one less context burden.
franktankbank · 7h ago
Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should.
d4rkp4ttern · 7h ago
Nice. Had to look it up, didn’t know it was a famous Jurassic Park quote, even though I did see it when it came out :)
franktankbank · 6h ago
Right back at you. I think its a pretty interesting application.
blueflow · 7h ago
> So it’s like Playwright/Puppeteer for the terminal
I mean, a tty is just a file descriptor... there have been script(1), expect(1) and chat(8) since the 80ies. tmux is not really necessary.
anuramat · 4h ago
"tmux capture-pane" strips escape sequences that break the terminal and sets all the right variables; try using expect with e.g. neovim
barmic12 · 3h ago
You right, it's pseudo terminal needed. The module pty of python can do this
er, the context in this subthread is tmux alternatives
0x457 · 2h ago
The context is "you don't need an entire terminal multiplexer such as Tmux when all you need is pseudo-tty".
Bringing another terminal multiplexer isn't an alternative. In my agent, I use pseudo-tty without any tmuxes/screens.
AlecSchueler · 5h ago
No, it wasn't, and I think you've missed the joke.
epr · 6h ago
These are all great. If you need to do something more involved, pexpect is also worth mentioning. It's a reimplementation of expect in python that's easy to be productive with quickly.
I used it in a previous job to automate configuring thousands of network devices
JdeBP · 7h ago
> if you do not set TERM with tmux properly, your colors will render incorrectly
This is of course true of every other terminal emulator as well, and indeed it's not only colours that are incorrect. Function and editing keys get recognized incorrectly; REP can get used where it does not work; and even simple relative cursor motions can be done wrongly.
TERM and the ideas incorporated into terminfo/termcap are inherent in the way that terminal devices work on Unices and Linux-based operating systems. That there are different terminals and terminal emulators not all speaking exactly the same protocol is also an unavoidable reality.
Setting TERM properly isn't some tmux-specific problem.
blueflow · 6h ago
Yet the author incorrectly blames it on tmux, which gives the article a bad taste.
Also im not sure whether the scolling problem is actually tmux fault. Tmux uses the alternate screen buffer, the alternate screen buffer is activated using the smcup/rmcup terminfo capabilities, whose semantics actually say that it "fixes" the window viewport in-place so absolute cursor movement has a known zero position. In this state, any native scrolling attempt should have no effect, and the keypress/scroll wheel events should be forwarded to tmux directly.
For some reason, every other terminal emulator still allows local scrolling in the alternate screen, which kinda breaks the semantics of smcup/rmcup and easy scrolling in tmux, too.
aragilar · 6h ago
Sadly after experimenting with a bunch of "modern" terminals I'm forced to consider that their primary audience is more interest in ricing than actually implementing the terminal commands (or connecting to anything other than their favourite linux box) and so I'm stuck with xterm as the only reliable terminal emulator that won't occasionally spew unreadable junk.
t_mahmood · 3h ago
And, actually having terminals crush. It is kind of absurd to have a terminal crush.
I've tried
Wezterm
Ghoatty
Ptyxis
First two had some frequent crushes, ptyxis is quiet reliable, but I felt it consumes too much memory for a terminal. But I feel it's a good terminal.
Though I wish I could get rid of the headerbar
elzbardico · 54m ago
you mean "crash"? But who I am to judge if you have a crush on a terminal, some of them are really beautiful in their minimalism. :-D
Modified3019 · 2h ago
What is “terminal crush”? I’ve not heard of this before.
partdavid · 1h ago
I'm assuming "crash"--it's a mild malapropism based on some varieties of English phonetics that I've seen before.
rstupek · 1h ago
I think he's referring to being married to or "crush" on the terminal you use
sgarland · 6h ago
Have you tried Ghostty? Its creator has been pretty serious about getting everything right.
nomad41 · 5h ago
I tried it a few months ago and it didn’t even have a way to search terminal output.
ironically, the last time i tried it in my normal workflow, it refused to interpret certain escape sequences... to the terraform cli application. i couldn't finish a `terraform apply` - i'd type `y` and hit enter but it would just print `^M`.
udev4096 · 3h ago
Oh yes, using a new terminal emulator instead of one which has been around for decades. What could go wrong? It's creator has been vocal that it's nothing more than a side project
nobleach · 6h ago
I agree. It's also true of nearly any program. If you do not set its configuration properly, it may not work as expected.
In the case of TMUX, it can be a bit annoying because it's not immediately apparent _why_ things look wonky. But I'm not sure what the solution is. Default to 256 colors?
JdeBP · 6h ago
Indeed, the TERM environment variable actually is the configuration of "nearly any program" (excluding the ones that aren't doing explicitly terminal I/O, of course, and the bad ones that just ignore TERM and make assumptions). Set TERM wrongly, and one has set the configuration incorrectly for a whole load of programs, in one fell swoop.
qudat · 4h ago
> Setting TERM properly isn't some tmux-specific problem.
Correct, but it's another layer to deal with. There are `tmux` specific TERMs that should be used which sit on top of your terminal emulator TERM. This was my point: you have another layer that you need to be aware of when using tmux and when debugging.
> PLEASE NOTE: most display problems are due to incorrect TERM! Before
reporting problems make SURE that TERM settings are correct inside and
outside tmux.
> Inside tmux TERM must be "screen", "tmux" or similar (such as "tmux-256color").
Don't bother reporting problems where it isn't!
> Outside, it should match your terminal: particularly, use "rxvt" for rxvt
and derivatives.
nickjj · 7h ago
I still plan to keep using tmux. I like how it manages multiple sessions, making it easy to switch between projects and even resurrect them after rebooting. I also never had a problem with mouse copy / paste using tmux-yank. I've been using this set up for many years.
One cool feature of tmux is its ability to send keys. I did that a few months ago when I was revamping my dotfiles. I kept changing aliases and other shell files and wanted to source those files in dozens of panes at once and also reload neovim when I changed certain config files.
> In summary: multiplexers add unnecessary overhead, suffer from a complexity cascade, because they actually have to translate escape codes, modifying them in hackish ways to get them to work with their concepts of windows/sessions.
This is a feature for me. Because less and less applications bother supporting termcap, this way some applications can still work on my VT520.
I don't really care what the kitty dev thinks anyway. He's entitled to his opinion but for me tmux is way more important. Also I think alacritty is better (though I generally just use Konsole).
As a user I only care about what works well for me, not what's architecturally the most elegant solution.
JdeBP · 7h ago
You are very lucky to have a VT520. I have been idly on the look-out for a 525 for years, but not only are they inordinately expensive, the people selling them are not on the same continent as I am (and probably don't have my country's version of the LK).
I've been on the lookout partly just to see whether this works properly with a genuine VT525:
Yes, should tmux ever go away, there's another option for transliterating terminal output of applications that just expect all of the modern stuff with AIXTerm's 16 colours and alternate screen buffers and mouse sequences and whatnot and do not check TERM properly. (-:
NoGravitas · 6h ago
My VT420 doesn't support hardware flow control, but software flow control does not play nice with many modern terminal applications. GNU Screen provides an extremely effective workaround, plus its other features. I've used tmux a lot on modern terminal emulators, but it seems to lack this important feature for vintage terminals. Glad that tmux solves your problems with broken apps that don't support termcap or terminfo.
plett · 8h ago
I view "you might not need tmux" in the same way as "you might not need browser tabs".
Yes, if you only have one or two terminal sessions or open web pages then you can probably live without using them, but anything beyond that leads you into reimplementing features to cope with your desktop's lack of ability to manage dozens of windows.
kccqzy · 30m ago
I have come to believe that tab management is really the job of the window manager not individual apps. My window manager allows me to tile windows, or create tabs out of overlapping windows. The tabs can be from the same app or even different ones.
3036e4 · 7h ago
That is something I have strived for recently, to use all the great window management features of my window manager of choice instead of browser tabs or lots of terminal tabs running tmux. If that didn't work well I guess it would have been a good sign that I need a better window manager. Even went back to use bookmarks instead of leaving hundreds of tabs open and having a bookmark bar instead of a tab bar is not bad at all.
bravesoul2 · 7h ago
But many terminals have tabs so if all you desire is more than one terminal open but not multiple ui windows there are other options. VSCode for instance!
jefurii · 2h ago
byobu+tmux lets me log into a remote machine once and then have multiple named sessions/workspaces each having multiple named tabs. The sessions persist when I disconnect and are there when I reconnect the next day. Is that possible with terminal tabs?
tezza · 7h ago
MS Windows has excellent multi window management with Alt Tab Win Tab etc. Far superior to others.
I have all my terminals with distinct icons and background colours to tell them apart. The operating system (Windows) does the heavy lifting.
i tried Mac for about five years but missed MS Windows “every window can be alt tabbed to”. Mac has “every app can be command tabbed to and therein each app has its own subwindow management”
mkl · 7h ago
> MS Windows has excellent multi window management with Alt Tab Win Tab etc. Far superior to others.
If by "others" you mean Mac, okay, but KDE and some other Linux desktops are at least as good as Windows at this out of the box, and much more customisable.
joleyj · 7h ago
> “every app can be command tabbed to and therein each app has its own subwindow management”
This is so, so annoying. Your Mac app’s window is minimized? No alt-tab for you!
sceptic123 · 6h ago
Just CMD+TAB to your required app, then hit ↓ arrow and you get access to all your windows. Minimised windows appear at the bottom of the screen.
anthk · 1h ago
WindowMaker under GNU/Linux and BSD was like that too...
But, OFC, both WindowMaker and Mac OSX come from the same NeXT grandaddy...
foldr · 7h ago
Just don’t minimize the window. Removing a window from the alt-Tab list is basically the only reason to minimize it in the first place on Mac. (Not reflexively minimizing windows does take some time to get used to if you’re coming from Windows, admittedly.)
layer8 · 2h ago
On Windows there are applications that minimize to the tray instead of remaining on the task bar. That’s my most common reason to minimize, so that it disappears from the task bar when not in use.
squigz · 7h ago
Macs must have some strange workflows that that's the only use for minimizing...
I regularly minimize some applications when I want to focus on others.
foldr · 25m ago
Minimization on Mac is essentially a legacy feature. There’s rarely any reason to use it.
em-bee · 5h ago
you can use workspaces for that. for comparison, gnome on linux doesn't even support minimizing windows any more. you move windows/apps that you don't want to use right now to a different workspace.
wtallis · 3h ago
You can also hide an entire application rather than minimizing specific windows. It'll unhide when you switch back with cmd-tab.
squigz · 7h ago
Windows has basic window and desktop management, but I would hardly describe it as excellent. Most tiling window managers would provide those features and then more.
sceptic123 · 6h ago
Whatever fits your mental model I suppose, but every window is accessible via keyboard shortcuts on the Mac too, it just needs a different approach.
coldpie · 4h ago
Do you know if there is a way to quickly switch between only two individual windows in different applications? A very common paradigm for me is swapping between two windows, for example a terminal session for code editing and a browser window for reference. On Windows and most Linux WMs, this is just a quick alt-tab hit to toggle between the two most recently focused windows. As I know there is no way to do this on macOS without bringing _all_ the windows to the foreground, which is not what I want. This is my #1 complaint about macos, I'd be so happy if there is just some shortcut I'm missing to accomplish this.
sceptic123 · 3h ago
I'm pretty sure that's part of what stage manager is for — you can drag windows in the same stage and they operate how you want — but there's too much manual setup required for me to realistically suggest it as an alternative.
There are a bunch of third party tools you can use though, [AltTab](1) is free and tries to replicate windows experience on Mac. [Raycast](2) has a Switch Windows command which also allows direct access to any window via the keyboard (bind to alt+tab if you like) amongst many other features.
Yeah unfortunately my work doesn't allow 3rd party apps like that (a reasonable restriction, IMO).
anthk · 1h ago
Alt-tab? You mean pressing win+w under CWM to fuzzy-find windows per title name, and then spawn it?
GNOMES · 3h ago
I have been tempted to drop tmux locally for native Ghostty panes/tabs, but I prefer the single height tmux status bar with window list only (set -g status-left '' + set -g status-right '') vs the thicker window decorations using macos-titlebar-style = tabs.
I did come up with Ghostty bindings to replicate my tmux settings if it helps anyone (my tmux leader is ctrl + space):
Nice, I came up with something similar when trying ghostty.
Were you able to replicate/setup continuous key hold for resizing?
The way I have it it tmux is that doing leader,Shift+hold h/i/k/j continually resizes a pane while I keep holding for example Shift+h. But I wasn’t able to replicate it in ghostty
GNOMES · 2h ago
Never realized you can do that. Can you share that tmux binding? Right now I use `bind -r Space next-layout` for resizing (spam repeatedly).
FergusArgyll · 5h ago
> Another example is buffer scrollback. It's one of those things where you
have to learn the tmux way of scrolling a window. You get used to it, of
course, but it's just not great.
And what about mouse select to copy/paste? It works most of the time, but
sometimes tmux gets ignored and I'm selecting across splits which makes the
thing I'm copying impossible to grab without bailing.
funny, those things make me use tmux! My 2nd laptop is a debian terminal-only laptop (it's very old), the mouse doesn't work so the only way to copy paste is tmux (or screen probably but I never learned it) For me, tmux is not replaceable
sevensor · 6h ago
Kitty is great; I want to see it succeed in pushing terminal emulators forward into the current millennium. However, I can’t use kitty at work, and I absolutely live inside of tmux. The server is where all the action is, and when I get disconnected, I want to be able to pick things up exactly where I left them. Window layout, the state of each shell and text editor, what’s in the copy buffer, scrollback, everything. I can’t give that up unless I have a suitable replacement on Windows. Until then I will continue to use tmux at work and kitty at home.
gorjusborg · 6h ago
I used Kitty for a while. I was impressed that I could recreate my tmux config pretty closely.
I went back to tmux and basic terminal because it works everywhere, and composing tools is just more durable overall.
em-bee · 4h ago
how do you do something like tmux sessions (not just windows) in kitty? how does switching sessions and windows work? can i connect to the same session in multiple windows? or can i manage separate windows with different sets of sessions?
esjeon · 7h ago
Interestingly enough, suckless folks took the opposite approach with their terminal:
> Goals … Do not reimplement tmux and his comrades.
I'd say suckless and Kitty are pretty much the polar opposites of development.
pure-orange · 8h ago
This doesn’t sound like a “you might not need tmux” argument. It more just argues than tmux is a pita on the terminal ecosystem which I’m sure is true. But the workarounds described are just reimplementing tmux features by taping together a bunch of tools. A better argument I think is - a lot of people do need tmux, so perhaps we should rethink protocols etc to make many of these features more native
mananaysiempre · 4h ago
At one point I was wondering if there was a preexisting protocol for a character-based framebuffer of some sort, that we could then use to slice the problem in a different way: a framebuffer multipliexer running terminal emulators inside it instead of a terminal multiplexer emulating multiple terminals into a framebuffer and then translating it back into terminal controls for the parent.
Unfortunately, my conclusion was that the only independent character-based terminal tradition is IBM’s 3270 stuff, but even setting aside IBM weirdness it’s simply not that. (Yes, there’s also such a protocol within tmux but it’s not really compatible with anything else.)
rollcat · 4h ago
> It more just argues than tmux is a pita on the terminal ecosystem which I’m sure is true.
Start thinking of tmux, screen, ssh, etc as terminal emulators, and everything will suddenly make sense.
> perhaps we should rethink protocols etc to make many of these features more native
I've been opposing terminal emulators (NOTE: emulators, not REPLs) for a long while. I also do believe we can collectively do better than emulating 1970s hardware. I do believe we can build applications where "ctrl-c" means copy, and selecting more than one screen's worth of text is possible. It's not hard, we're just stubborn.
em-bee · 4h ago
nitpick: ctrl-c never meant copy until windows started to dominate. it didn't even mean that in DOS. selecting more than one screens worth of text is possible in gui terminals and also in tmux.
but i agree with your general point: we can collectively do better than emulating 1970s hardware
absolutely!
rollcat · 2h ago
> nitpick: ctrl-c never meant copy until windows started to dominate. it didn't even mean that in DOS.
VT102 wasn't designed with multiplexing in mind. The device was meant as a primary way to interact with a computer, not to perform the tasks of one - your physical keyboard also doesn't understand "copy".
> selecting more than one screens worth of text is possible in gui terminals and also in tmux.
It is but it isn't. You want to copy a multiline snippet of code you just wrote, you will have to manually strip away $PS1 & $PS2. You want to copy from vi into another window, you can't use the mouse - and you have to use a side channel.
I have 20+ unfixable issues outlined, and I'm in the process of writing a blog post... But at my current rate, it could become a book.
em-bee · 1h ago
It is but it isn't.
ok, yes, i was just talking about the simple case. you are right that the issue is more complicated, so i actually agree with you. i am talking about similar problems here: https://news.ycombinator.com/item?id=44757142
i am looking forward to your post. i added your blog to my rss reader
mananaysiempre · 2h ago
Nit: didn’t Ctrl-X/C/V come from the original Macintosh? I thought Windows initially followed IBM’s CUA, where cut / copy / paste are instead Shift-Delete / Ctrl-Insert / Shift-Insert (and those still work too).
layer8 · 2h ago
The original Macintosh had Command-X/C/V, and Windows 3.0 adopted that in addition to the existing CUA shortcuts, but changed Command to Control, as Alt was already in use for menus and form control shortcuts on Windows. So it’s true that Ctrl+C for Copy only became a thing with Windows.
em-bee · 1h ago
ah, that's a history detail i didn't know about. very well, it's apple's fault then :-)
anthk · 1h ago
That's Emacs for you. No, seriously. Have a look to eshell and elisp.
pastage · 4h ago
Having native scroll back should be possible if you hack tmux and a terminal emulator.
charcircuit · 7h ago
It's more like you don't need to use a webpage that offers tabs using iframes because the browser natively has tabs that you could be using instead.
dizhn · 4h ago
weztern has a really strong solution in this space when you use it with its multiplexing server on the remote end.
ho_schi · 39m ago
I keep using GNU Screen
* Scrolling on TTY (Linux itself doesn’t support this for some years)
* Window-Tabs on TTY, Wayland, SSH
* Sessions
* Copy/Paste
I’m not using ZelliJ or Tmux because I don’t need more features and I know the shortcuts. I’m fine and don’t need weird workarounds. This article even confirms my decision!
Would love some good C developers helping the Screen people.
cogman10 · 2h ago
I'm by no means a tmux power user, but it does have really nice features for when I need it.
The primary usecase I've had for it is I can kick off 1 or multiple long running jobs, exit, and then come back later and checkout the various stdout logs to see how it worked.
Could I accomplish the same thing with a bunch of stdout pipes, disown, fg, ctrl-z, etc? Sure. However, tmux makes it really easy to do that and then quickly switch around sessions to see how things are going.
In the simplest workflow, it looks like this
tmux
longcommand()
ctrl + B D
and later
tmux -a
to checkout and see what's gone on with the command long after I disconnected with ssh.
mickeyp · 8h ago
Better still, use Emacs as your terminal multiplexer:
I never heard of shpool, so just tried it. shpool completely breaks my PROMPT_COMMAND because it assumes that each word (in the shell sense) is a separate command. My PROMPT_COMMAND included "history -a" thus causing it to run "history" and "-a" on every prompt, making things quite unusable.
It's quite maddening because all they had to do was write a lot less code to fix it:
eval "${SHPOOL__OLD_PROMPT_COMMAND}"
Would run the old prompt command just nicely instead of the much longer:
for prompt_hook in ${SHPOOL__OLD_PROMPT_COMMAND};
do
${prompt_hook};
done;
samgranieri · 25m ago
I’ve migrated from tmux to zellij. And I’m playing around with omarchy and am really digging the tiling window manager feature
jrm4 · 3h ago
Obviously, different ways for different folks -- I never got into tmux, but perhaps relatedly, what I want is a well thought out and stable terminal/GUI filemanager hybrid thing; e.g. I can either "cd" or just click where I want to go, etc. I've seen half done implementations of this but nothing comprehensive?
layer8 · 2h ago
What would happen when you click on a directory (I’m assuming you’re imagining a directory tree on the side in a separate pane) while some CLI program is running? Run the corresponding cd when the program exits and returns to the shell?
jrm4 · 1h ago
Yes, but I'm imagining that this isn't something that works in conjunction with another terminal program, but that it's one program -- some kind of shell/GUI hybrid.
I have actually seen this before, in the very fun but silly and not-particularly-useful edex-ui thing. (great way to impress people who don't know, but like, if you type your password in it it literally shows the keystrokes)
The keystrokes are so ingrained into me that you can take tmux from my cold dead hands.
I use it a bit with remote connections, but tmux is basically my IDE for development. I have the backtick mapped as my prefix and I hope between terminals and Neovim, and I am considerably less productive when I don’t have this setup.
dllthomas · 2h ago
I use tmux (or screen) as a bag for holding context. I set an environment variable before spawning it, and then key a lot of things in my .bashrc off that environment variable so I get context-specific functions/aliases/vars/etc, and keep them when I open a new window in an existing tmux. The single best part of this is separate histories for my development vs system administration vs whatever, although the rest is still quite useful.
sgarland · 6h ago
Same. I’ve also been semi-forced to learn expect due to abysmally bad UX for how my company handles security (VERY secure, but in the most obtuse way possible), and that’s been a godsend. Not storing anything locally other than metadata, but expect lets me skip the obnoxious manual copy/pasting I would otherwise be doing.
Sometimes, the old ways are better. A lot of times, actually.
hollowonepl · 1h ago
I just browsed through to realize that this is not criticism to tmux very existence. It’s just author found his own ways. That’s OK. I was once screen user, tmux extends that, but comes with emacs keyboard combos like if I was doing Mortal Kombat fatality trick for a simple thing and I personally found zellij more user friendly to me, unless I launch my linux box with i3 where all that is basically replaced by a quite interesting compositor. Point is… there are many ways to solve a problem… finding one that works for an individual doesn’t automatically create religious dogma… unless one wants to be internet famous for 72h and then forgotten until another dopamine shot hits.
jauntywundrkind · 2h ago
Tmux has definitely caused me some pain too. I'm mostly back now (semi alas) but for a while I was using shpool adjacent dtach to leave nvim sessions running even if I logout. If I was doing things on the terminal, it would be inside an nvim terminal window.
My workflow is project oriented, and I have to juggle multiple projects. So I wrote a small script to let me quickly either attach to an existing dtach session for a project by name, or to start a dtach+nvim session for a project.
Also included some fun wildcarding, so I didn't have to type the full name of the project out, could just type some letters and hit enter.
I don't see change as likely, but it does strike me as absurd that although I had gotten rid of tmux as a redundant window management system, I still had both the OS and nvim's window management going. The author talks about how things would work over ssh, but ideally to me, I could ssh in, forward some ports, and start some new terminal emulators that open multiple nvim clients that attach to a persistent perhaps headless nvim session.
dankobgd · 3h ago
I don't need much. I tried zellij but i couldn't stick with it.
I either had to lock/unlock or change keybinds which is also annoying.
Now i use ghostty and i can create new splits, tabs and i know few shortcuts to move around and resize and that's it.
yoyohello13 · 2h ago
Zellij now has a mode that uses a leader key style. So no need to lock/unlock.
imcritic · 3h ago
But Zellij supports tmux hotkeys.
aragilar · 6h ago
It's a bit unclear what the limitations of the non-screen/tmux alternatives are E.g. how does the scrollback work if I were to disconnect and then reconnect with a different machine, can I view the scrollback like screen/tmux?
It's also nice to be able to re-connect and be able to resume a session without having to reopen many terminals, which you would lose with the lack of window management.
canistel · 7h ago
From what I have seen, tmux is the _only_ multiplexer with with you can select from the scroll-back buffer using only the keyboard (without using the mouse).
meitham · 7h ago
Absolutely! You also have full control over the history size, along with powerful search capabilities. You can move panes and windows seamlessly across sessions, and even share those sessions with other users. My yank script integrates with tmux buffers, so copy/paste works flawlessly, even in vertical splits. I strongly disagree with the article; I simply can’t imagine using a terminal without tmux.
jmholla · 2h ago
screen does as well. Unless I'm missing something here.
magarnicle · 6h ago
Do you mean select into the clipboard?
canistel · 6h ago
To tmux's clipboard and if required to the system clipboard too...
set -s copy-command 'xsel -i'
sbinnee · 4h ago
My fingers are just too used to tmux and I can do all I want to do. But I hear the scroll issue. When I have to copy multiple chunks, I have to go to cp mode visual a chunk and as soon as I enter tmux goes to the bottom line and I have to scroll up again…
elzbardico · 56m ago
All good points relating to friction points with tmux.
But, I am not an uber-elite-geek and Zellij is a good enough compromise to me.
It gives me the things I am too lazy to solve by myself like tmux, with a lot less pain points.
panki27 · 8h ago
Switching to WezTerm has completely eliminated the need for tmux for me - except for stuff I want to run server side, disconnect and come back to.
WezTerm is not necessarily something I want to deploy and keep up to date on hundreds of machines, screen/tmux are still fine for that.
aragilar · 6h ago
Maybe I'm a bit weird, but I don't know why you'd want to run tmux locally as an alternative to using tiling wm/tabs/other equivalent feature of your terminal emulator? I use tmux in two ways:
1. Persistent long-running sessions (which typically involve having more than one tty going at once, so something like shpool seems like a downgrade).
2. Local named-network-namespace sessions where I'm connected to a VPN and so not having to reconnect to the same namespace/vpn for every new tty is a benefit.
Also, if you do physically connect to a headless machine, it's nice to not need to keep having to open a new getty session (or be able to log out of a session) ;)
em-bee · 5h ago
i have 5 tmux sessions with a total of 19 windows on my laptop, one of which contains a localhost ssh connection to a second account where i have another tmux session with half a dozen windows. not to mention the tmux sessions i have on my servers.
the key benefit is i only need to learn one set of commands to switch sessions and windows, and to create new windows.
the sessions all run in a single terminal window, so when i have multiple other windows, i don't have to switch between them to find the right terminal window. terminals have tabs, but they don't group tabs into sessions. a single terminal with 19 tabs would not work.
i use the gui to start the terminal. i would have to find out how to script starting a terminal with multiple tabs. tmux is more easily scriptable, and again, i can't avoid learning tmux, since i use it remotely, and so when using it locally too, i don't have to learn a different way for my local machine.
finally, although rarely needed, i can log out, or my gui can crash, but the tmux sessions survive. i can also connect to my laptop from a different device and attach to the tmux sessions that way.
for a gui terminal to replace tmux the foremost feature i need is for it to remember my windows and tabs, just like the browser does. i have not come across any terminal that does that (but i admit, i haven't done a exhaustive search either). gnome (or any WM) can remember which apps i have open, but it can't remember the state inside the apps.
being able to reproduce state is really the key. i have a few vim sessions for example, easily remembered and recalled from my command line history. i could use gvim if i could figure out how to connect a gvim window with a terminal such that they form one unit, because every vim session is connected a number of commandline operations. (i believe BeOS/haiku can potentially do that based on the way its window tabs work)
atq2119 · 4h ago
> localhost ssh connection to a second account
Any particular reason why you cannot simply use su or sudo for this?
em-bee · 4h ago
it would not make a difference, would it? do you see any benefits? ssh -X can forward windows to my gui and it just works.
rkangel · 5h ago
Two reasons:
I don't use a tiling WM, and tmux[1] does an excellent job at the tiling features.
I do the majority of my work physically at a Linux (Fedora) desktop, but I also work from home SSH'd to that desktop. Being able to just attach to the same session and pick up where I left off, with all the same shell management, is great.
[1] I used tmux for years, but have very recently switched to Zellij. I find the pane navigation to be much smoother (and more discoverable).
strobe · 7h ago
same, and those 2 plugins together completely eliminated need for tmux/zelij locally
These seem nice but honestly feel like overkill for the most basic (and probably most typical?) use of tmux and similar.
I generally have a single session I care about per machine (rather than per project) and wezterm's built-in multiplexing handles this out of the box.
barnabee · 7h ago
I agree. I've used first Kitty and more recently WezTerm (and now occasionally Ghostty, too) for years and every time I've tried tmux/zellij I've found nothing (except as you say for occasional long running server sessions) in either that justifies the noticable latency increase for me.
selectnull · 4h ago
I'm the same. And I run tmux on server when needed. Best of both worlds.
bezmiran · 7h ago
`wezterm ssh` can do this if wezterm is installed on the host.
zeendo · 4h ago
Yeah - it seems like this is a pretty undersold feature of WezTerm. It has completely eliminated tmux and Zellij for me outside of pairing with others.
zettabomb · 6h ago
The conclusion I come to from this is that yes, I actually do need tmux, as the alternatives proposed are far more annoying and provide no benefit. I don't have a need for graphics in the terminal, and frankly I find it odd that we wouldn't simply display graphics... with the graphics system. But I do have a need for seamless session persistence and multiple terminals, and I do enjoy splitting a window when I'm running a command on multiple servers.
finaard · 3h ago
If you're using kitty and have terminal related problems the easiest solution usually is just not using kitty.
tpoacher · 5h ago
Don't use tmux. Use a nice wrapper for tmux instead (e.g. like byobu).
Otherwise complaining about tmux and talking about hacky workaround alternatives is a bit like complaining about the internet and advocating for the telegraph as a hacky alternative because you don't like writing your own HTTP requests by hand and morse code is so much simpler.
Having said that, if really all you want is pane splits / window management, lots of terminals have their own solutions for this. Guake is a good one.
disclaimer: I use Guake and still prefer to just use tmux (byobu) from Guake
em-bee · 3h ago
does guake support multiple sessions? remembering window layout through restart? or easily configurable startup layout?
c120 · 6h ago
I need "tmux" on remote linux machines that don't allow me to install "screen". If there's an easier way to keep a session running (and interactive) over internet disconnects, I have not found it yet
zeendo · 4h ago
If you can't install screen then I'm surprised you can install tmux - BUT if you can install wezterm then it solves this need nicely by adding sessions + multiplexing to the terminal emulator itself.
If I were to stop using tmux, the things I would need to replace are:
1. zoom-pane (temporarily make one pane be the only pane) (also can someone please add this to vscode!)
2. keybindings to navigate focus between panes according to their layout positions
3. ability for another process to programmatically change which terminal window has focus, and window naming
I think that's it. Could probably hack most/all of that together with hammerspoon I guess. I don't use it for persistence, and I certainly don't like the scrollback UX. It has got in the way from time to time, principally with its slow adoption of hyperlinks. But I'm general it's been a huge win for years.
matthieucan · 6h ago
Have you tried "View: Toggle Maximize Editor Group" in VS Code? In my setup, it does roughly the same thing as with a tmux pane.
sabellito · 6h ago
1. workbench.action.toggleMaximizedPanel
imcritic · 8h ago
Correct statement, but poorly chosen alternatives: zellij is like tmux, but with less scrollback issues and supports mouse.
It is also extensible.
seanhunter · 8h ago
Zellij is great. I have been very happy since I switched over.
Nope. I use it with alacritty and I don't do things like trying to click on the bar etc that people are reporting as bugs. I have no idea why you would even do that. If you drive it from the keyboard as a "better screen/tmux" it works great. At least it does for me.
eawgewag · 2h ago
I only use tmux for one reason -- for a script that setups my local server and runs backend/frontend/etc
If there's a better way, I'm open to it. As of right now Claude can't vibe code me a script that opens two ghostty tabs, so tmux it is
slim · 37m ago
If your main issue is session persistance you should try using mosh
Session persistence is the key feature for me. All the rest I don't need because i simply open more windows. However multiple windows (or whatever you call them) were really useful when I bought a vt100 as a teenager and programmed on that for a while for fun (with screen at the time, not tmux).
sligor · 8h ago
Yes the clean and efficient alternative would be a session manager "server" running on the server and communicating with the terminal "client" (like kitty) using a more efficient protocol for handling panes/windows/drawing etc...
So terminal clients just have to implement this protocol... it's already implemented in iTerm2
skeptrune · 1h ago
This sounds strictly more complicated than just using tmux.
tux3 · 8h ago
People here are missing the point of the solution described in the blog post.
This isn't about reinventing tmux poorly. They're trying to keep their workflow without having a muxer in the middle that needs to understand and translate every feature of the protocol, which is the core concept and the major problem with tmux.
If you do splits client side, you don't have any software middlebox trying to interpret the traffic, so you keep native scrollback and all the fancy features of your terminal are still here.
That's what the blog post is about. Not reinventing tmux, but getting rid of the muxing.
mongol · 8h ago
In the Youtube interview with Goyal linked in the post, he explained this well. He said he contemplated developing another approach for this if he found time, where the multiplexer communicated with the terminal differently. Hope he gets to work on it.
kzrdude · 4h ago
I recommend the interview, it's very good. It should be available in podcast form as well. The Kitty author comes across very well in the interview
jdbernard · 6h ago
I don't use tmux because I have to. I use it because I love the way it works. The issues the author of the article and Kovid Goyal raise are not issues for me in practice. If something is built that better suits my needs, I'll be happy to switch. I am particularly sympathetic to Goyal's gripes about the performance/resource wastes of a multiplexer.
But I also take issue with statements like "terminal multiplexers are a bad idea, do not use them, if at all possible" (from the kitty FAQ and the YouTube video linked in the article). Tmux solves a number of real problems for me that Kitty doesn't. Kitty also seems to be moving in a direction that I am not interested in. It's tied to a windowing system when I want a terminal that I can use headless. Even with the hacky workarounds the article mentions, it doesn't really support session persistence when I use this feature of tmux weekly. It introduces a lot of features that are likely to lead to visual noise when the constraints of text-only are one of the main reasons I like terminals (personally I don't want images in my terminal, full stop).
Now, all of this is fine. It's the other statement, "[tmux acts] as a drag on the ecosystem as a whole, making it very hard to get any new features," that causes it all to rub me the wrong way. The only reason you feel like tmux acts like a drag is because there are users like me who won't switch to something like Kitty if it doesn't support tmux. So don't worry about us. Build a new thing that is not backwards compatible and live with the fact that many people won't use it. If you really want to drive the ecosystem forward as a whole, be less condescending about real use-cases that bring benefit to real users.
To be clear (because text is a limited medium), I'm not grumpy, angry, or against Kitty because of this. But I am dismissive.
yoyohello13 · 3h ago
I highly recommend zellij if you’re looking for a newer multiplexer. It give a bunch of tmux features but without some of the legacy baggage.
ramon156 · 7h ago
Zellij has started to become messy in my setup (i don't mean to blame zellij, i just suck), so I'm looking into tmux now.
I liked the fact I didn't need to set anything up for Zellij and could gradually add stuff
nobleach · 6h ago
I gave Zellij a shot a few months ago. It really felt too "modal" for me though. I've been a Vim user forever so I'm not exactly modal-averse. But TMUX has always felt more like Operator Pending mode in Vim. Having Zellij feel like full-on Normal mode was frustrating. After I gave up, someone told me they had their Zellij configured just like TMUX, and I should give it another shot with their config. I still haven't gotten around to it.
metaltyphoon · 3h ago
Zellij has added a "locked" mode (defaults to Ctrl + g) where it acts just like Vim's normal/insert modes. So when to do mux commands you unlock it first.
em-bee · 4h ago
could you share that config please? as a tmux user i feel like i might run into the same problems, and so a tmux like setup might be a good start.
charlie-83 · 7h ago
I think a key piece of context to Kovid's distain of tmux is how good window management is in kitty. I regularly have at least ten terminals open and navigating them is a breeze. I previously lived in tmux but much prefer this.
The session persistence thing is still best solved with tmux, however, I don't ever need this. Nohup is sufficient for long running commands where my ssh might fail. I don't really find myself sshing into a machine and then setting loads of env vars that I need to persist.
jon-wood · 7h ago
More generally I use a tiling window manager which is already doing pane/tab layout for me, but doing that with every window I have, so I don't really want tmux acting as a separate window manager just for shells.
kovid is talking about how tmux gets in the way of terminals adding new features. i agree with that, but what about the features that tmux offers that i have yet to see in any gui terminal. (multiple sessions. the ability to connect to the same session from multiple terminals. scriptability, including sending characters into a terminal. splitting windows into multiple panes...)
can kitty do any of those? if you want to add features to the terminal, then you have to content that tmux does as well, and maybe tmux features are more interesting to me than kittys. so if you want to win me over, then you have to actually implement some of the features of tmux that i use.
(watching the interview, it looks like kitty does indeed implement some of tmux features, because interestingly the interviewer asks just the right questions. but i need to look for a more comprehensive introduction to see how kitty can replace tmux locally.)
metaltyphoon · 3h ago
It seems that WezTerm can do what you asked
gchamonlive · 7h ago
For long running sessions I think screen is better... `nohup cmd &` is finnicky and I don't trust it to work on every software. I think `screen -S foo` and `screen -r foo` is much more ergonomic. No pipe to file, no disowned pid.
rnhmjoj · 8h ago
I stopped using tmux, but not for the reasons mentioned here. I think tmux is perfectly fine, I just don't like the default keybindings and I could never remember how to copy/paste between windows.
I've switched to abduco for persistance and use neovim for window management (both vim and neovim have a built in terminal emulator). Using vim keybindings for managing windows and tabs is more natural, I can copy/paster just normally and you even get some perks like `gf` to quickly open a filepath under the cursor.
em-bee · 4h ago
is the vim terminal support that good now? i remember it being brittle. some apps, especially apps that use the full terminal window didn't run well inside the vim terminal.
rnhmjoj · 1h ago
The neovim terminal is pretty decent, the only feature I miss is reflowing the text on resize. I haven't used the vim one extensively, but I've heard it may even better than the neovim one.
t_mahmood · 3h ago
Why would one go through so much trouble when you have tmux?
But I really want Vim to color properly in it, can anyone give me the right solution?
> act as a drag on the ecosystem as a whole, making it very hard to get any new features
I dont see this as an issue though. Terminals are pretty much a solved problem, they dont need any new features. IMO it makes more sense to spend effort on improving tmux<->terminal interop rather than adding fancy graphics protocols that we dont actually need.
em-bee · 4h ago
it's not fancy graphics that's missing from the terminal. but things like selection of text areas. (you can only select across the whole screen now, and if you are lucky you can select rectangles. but if i display text in multiple columns i'd like to be able to select one column at a time for example. this bites me every time when i use tmux or vim split windows. also filesystem navigation could be improved, multiline commandline editing is sorely lacking. fish tried that, but failed to make it work. clearly a limitation of the terminal.
so no, terminals are not a solved problem.
cestith · 3h ago
Vim itself can select a column.
em-bee · 3h ago
but it's non-trivial to copy that selection to the outside of vim to another app.
i can select a column in tmux too, using tmux commands, and then it's the same problem. i can't use that selection outside of tmux.
i simply want the GUI to be aware that there are multiple columns in the terminal and let me select text within one using the mouse and then copy that to a different window/app.
nathan_compton · 7h ago
I just use Emacs for this.
prmoustache · 5h ago
I am regularly using waypipe to use a remote kitty terminal.
znpy · 9h ago
Sounds like work-arounds and duck-tape-tier re-implementation of tmux features, to be honest.
I'm still a gnu screen guy, but for me the trade-off is still in favour of screen/tmux.
nobleach · 6h ago
Honestly, my only gripes with TMUX have been:
1. Having to zoom a window before copying multiple lines of text (Kovid brought this up in the interview that was mentioned in this article)
2. The weirdness of copying text from the scrollback buffer into the clipboard
I've tried so many things for the second one over the years. I think I have it working okay-ish these days. But there are still plenty of times that I say, "aw screw it", and literally use the terminal's copy command.
Every other solution to my multi-terminal workflow have been worse though! i3/bspwm with multiple terminals were okay. It was just hard to have "projects". I'd have to visit each terminal and switch to the proper directory, launch servers/docker-compose/etc.
Zellij felt like too much "hopping out into manipulation mode, manipulating, then hopping back into work mode". Those milleseconds were enough to halt my flowstate.
Single terminal with built-in tabs/splits felt clunky as I couldn't get the keyboard shortcuts into muscle memory (perhaps more time would help)
anthk · 1h ago
TMUX supports sixels just fine. It's a damn standard, and you have it at
OpenBSD's base. Keep It Simple, Stupid.
Also, tmux new-window does wonders with software spawned from sfeed, sacc and who knows how many TUI/CLI tools.
You open your RSS feed list with sfeed, read the whole page with C under 'less', and if there are images, you can spawn Links in another page with 'o'.
jollyllama · 4h ago
You lost me at nohup.
scudsworth · 4h ago
very interesting. im going to continue using tmux instead of doing any of that.
submeta · 6h ago
I love tmux in combination with tmuxinator. Because with one command I can start my dev setup with one split for nvim, one for lazygit, one for yazi and one for claude code. In another window I can run the server, in another I can tail the logfiles.
I have similar setups for various projetcts and do not need to manually start services, tools, whatnot. With `mx projectx` everything is started within seconds.
And navigating panes and windows is super easy with the proper shortcuts (opt+h,j,k,l), even across tmux and nvim.
Why would I give up on that?
timeforcomputer · 3h ago
Thanks for the link to tmuxinator, I had heard of it but never learned what it does. I think I'd like something like this.
But I think this is a case of tmux providing a platform, I think the core idea of tmuxinator could be implemented outside of tmux, so tmux in that regard is basically an implementation detail.
Then it is a pragmatic decision, using tmux you get to use the ecosystem of things like tmuxinator which explicitly target tmux to get a known number of terminal features like splits.
What I learn from the OP, is that there are technical reasons that tmux is not a "good design" - like Kovid's comments on how it constrains innovation in terminal designs - which might lead someone to consider, what actually does tmux do and could my workflow be implemented otherwise?
It might be a bunch of unixy hacks and tricks (as another commenter here said) but it can work. I'd imagine recreating something like tmuxinator would be hard though, but it could also be interesting, like having arbitrary GUI programs configured to appear in "splits" using tiling integrated seamlessly within the terminals. But yeah, if the workflow is already set up and serviceable and supported with a community, using tmux, then I'd just keep using it.
gempir · 6h ago
Tmux prevents vendor lock-in but on Terminal level. It's so established and standard that everyone knows they need to support it, which is great.
I don't need my terminal do display pictures, render video or whatever crazy features they come up with next, I want a solid base with the essentials.
The rest the Operating system applications can probably do better anyway. VLC, MPV, Apple Preview IrfanView etc.
That's why I love Alacritty, no fuss, no overcomplication. The basics, fast and stable.
tiffanyh · 3h ago
Reminder: terminal multiplexers (like TMUX, Zellij, and Screen) are terminals too — even if often overlooked as such.
So, if your multiplexer lacks support for certain features, it will limit functionality in advanced terminals like Kitty or Ghostty.
deadbabe · 2h ago
If I could just figure out how to scrollback in ghostty I probably wouldn’t bother with tmux.
ninetyninenine · 3h ago
I was in the same boat then I discovered this thing called a GUI and inside this GUI I could use this thing called tabs. It was revolutionary technology.
It’s just too bad I suffer from a lack of common sense and insistence on trying to believe that all archaic terminal text based tools are better than anything else. I’m a developer and developers have insight on the best UI and we know that terminals are better than anything in the known universe. If you use a mouse you’re an ass hole.
z0r · 3h ago
I too also don't understand other people's workflows but believe I know the best way to interact with a computer.
ninetyninenine · 2h ago
Agreed. Stupid people with stupid opinions don’t exist. Everyone’s opinion is valid. We must be inclusive of people with bad and wrong ideas. All criticism is wrong because saying someone’s workflow isn’t good will hurt their feelings.
Useful debate on the merits of anything is a pointless endeavor because all varying opinions are valid. There is no best, better or worse… just everyone’s freedom of opinions.
In my opinion eating lead is good for you and using a mouse and clicking on tabs hinders my efficiency by 300 percent. That’s my opinion! And it’s valid! I am valid!
em-bee · 2h ago
not appreciating the snark. tmux does way more than being an alternative way to get tabs.
ninetyninenine · 2m ago
Ok. No snark. Sessions, tabs, windows, tiling . All done in GUIs and done better.
Tmux is good when you have no gui.
But all this endless getting square pegs to fit in a round hole is what causes the snarks. Like you want to draw windows? Let’s use terminal characters instead of lines! Makes perfect sense.
I find it incredulous that a lecture had to get this guy to realize what’s wrong with tmux and he still doesn’t see that this problem can be avoided by using a gui. He still goes for terminal abstractions.
GUI is an obvious solution. But this guy is blind.
With this in my `~/.ssh/config`, I can just type `ssh tmux` to get back to my remote dev box whenever I wake my computer or change connections.
With iTerm2's tmux integration enabled, this will pop open a new window where the remote tmux tabs and scroll buffer look and act just like native, local iTerm2 tabs and scroll buffer. I don't even know any tmux commands.I wanted it to be better, and might go back if I could figure out the font issues, but I just don't have the time right now.
So you're saying you're a masochist
The author of this feature also ported it to the Windows Terminal.
Besides, Chrome OS’s built in terminal also has tmux integration.
Would love for examples using Windows Terminal as well.
https://gnome-terminator.org/
> In summary: multiplexers add unnecessary overhead, suffer from a complexity cascade, because they actually have to translate escape codes, modifying them in hackish ways to get them to work with their concepts of windows/sessions.
What does that have to do with you using tmux? You're not the one maintaining tmux's codebase.
This problem is in no way unique to tmux. You have the same problem with any terminal app that takes over drawing, eg vim. That said it is also easy enough to fix.
The solution is OSC52, a terminal escape sequence that the emulator can use to interact with the system clipboard (kitty, alacritty, iterm2 all support this). The first step is to get you a script that writes out data in that protocol. Its easy enough:
Now you can do this:$ grep my_thing < some.txt | osc52-copy
And whatever got into osc52 is now on your system clipboard.
Tmux (set -g clipboard on) and nvim (unset clipboard) both have native osc52 support, and the script above can be used to integrate other places.
So I used Claude Code to build a little el tool called Tmux-cli, which gives a convenient way to have CC (or any CLI coding agent for that matter) spawn a Tmux Pane, launch a script there, and actually interact with it.
So it’s like Playwright/Puppeteer for the terminal.
You can get it via
https://github.com/pchalasani/claude-code-toolsThere are some interesting possibilities this enables:
Let CC autonomously test interactive CLI scripts, without me having to intervene and point out errors.
Have the CLI coding agent launch UI from another pane and then use Puppeteer MCP to test from a browser.
Let CC launch a cli script with a debugger enabled (e.g. Pdb) and set breakpoints etc — for token-efficient code understanding, debugging and explaining.
Let the CLI coding agent spawn and drive another instance of the same or other CLI coding agent, AND interact with it. Note this is way better than CC sub-agents which are “spawn and let go” black-boxes.
I wonder if the discussed Tmux alternatives enable building this type of tool.
In case anyone was curious, screen can do this too with the command "stuff" (read it as the verb like "stuffing something into a box").
Very cool ideas in this thread.
Could I have kitty send each line it receives to an external tool, say via HTTP?
I want to make a custom frontend to claude code, or any other CLI tool, and an obvious easy frontend is a web tool that communicates over HTTP, so getting claude wrapped in a HTTP control system seems like a good starting point.
I'm interested in whether things like "tmux capture-pane" which strips characters come from Kitty as well? Do I need to be cautious of control characters?
I tell Claude to use the existing tmux CLI to send-keys, capture-pane, etc. and it works flawlessly. Literally just "never use the Bash tool, run all commands in tmux sessions" and it knows what to do from there.
I mean, a tty is just a file descriptor... there have been script(1), expect(1) and chat(8) since the 80ies. tmux is not really necessary.
Bringing another terminal multiplexer isn't an alternative. In my agent, I use pseudo-tty without any tmuxes/screens.
I used it in a previous job to automate configuring thousands of network devices
This is of course true of every other terminal emulator as well, and indeed it's not only colours that are incorrect. Function and editing keys get recognized incorrectly; REP can get used where it does not work; and even simple relative cursor motions can be done wrongly.
TERM and the ideas incorporated into terminfo/termcap are inherent in the way that terminal devices work on Unices and Linux-based operating systems. That there are different terminals and terminal emulators not all speaking exactly the same protocol is also an unavoidable reality.
Setting TERM properly isn't some tmux-specific problem.
Also im not sure whether the scolling problem is actually tmux fault. Tmux uses the alternate screen buffer, the alternate screen buffer is activated using the smcup/rmcup terminfo capabilities, whose semantics actually say that it "fixes" the window viewport in-place so absolute cursor movement has a known zero position. In this state, any native scrolling attempt should have no effect, and the keypress/scroll wheel events should be forwarded to tmux directly.
For some reason, every other terminal emulator still allows local scrolling in the alternate screen, which kinda breaks the semantics of smcup/rmcup and easy scrolling in tmux, too.
I've tried
Wezterm Ghoatty Ptyxis
First two had some frequent crushes, ptyxis is quiet reliable, but I felt it consumes too much memory for a terminal. But I feel it's a good terminal.
Though I wish I could get rid of the headerbar
In the case of TMUX, it can be a bit annoying because it's not immediately apparent _why_ things look wonky. But I'm not sure what the solution is. Default to 256 colors?
Correct, but it's another layer to deal with. There are `tmux` specific TERMs that should be used which sit on top of your terminal emulator TERM. This was my point: you have another layer that you need to be aware of when using tmux and when debugging.
Just look at the top of tmux's FAQ:
https://github.com/tmux/tmux/wiki/FAQ
> PLEASE NOTE: most display problems are due to incorrect TERM! Before reporting problems make SURE that TERM settings are correct inside and outside tmux.
> Inside tmux TERM must be "screen", "tmux" or similar (such as "tmux-256color"). Don't bother reporting problems where it isn't!
> Outside, it should match your terminal: particularly, use "rxvt" for rxvt and derivatives.
One cool feature of tmux is its ability to send keys. I did that a few months ago when I was revamping my dotfiles. I kept changing aliases and other shell files and wanted to source those files in dozens of panes at once and also reload neovim when I changed certain config files.
The above was pretty easy to pull off using a combo of tmux's built-in commands and a shell script. I made a post and video about that here: https://nickjanetakis.com/blog/running-commands-in-all-tmux-...
This is a feature for me. Because less and less applications bother supporting termcap, this way some applications can still work on my VT520.
I don't really care what the kitty dev thinks anyway. He's entitled to his opinion but for me tmux is way more important. Also I think alacritty is better (though I generally just use Konsole).
As a user I only care about what works well for me, not what's architecturally the most elegant solution.
I've been on the lookout partly just to see whether this works properly with a genuine VT525:
* https://jdebp.uk/Softwares/nosh/guide/commands/console-termi...
Yes, should tmux ever go away, there's another option for transliterating terminal output of applications that just expect all of the modern stuff with AIXTerm's 16 colours and alternate screen buffers and mouse sequences and whatnot and do not check TERM properly. (-:
Yes, if you only have one or two terminal sessions or open web pages then you can probably live without using them, but anything beyond that leads you into reimplementing features to cope with your desktop's lack of ability to manage dozens of windows.
I have all my terminals with distinct icons and background colours to tell them apart. The operating system (Windows) does the heavy lifting.
i tried Mac for about five years but missed MS Windows “every window can be alt tabbed to”. Mac has “every app can be command tabbed to and therein each app has its own subwindow management”
If by "others" you mean Mac, okay, but KDE and some other Linux desktops are at least as good as Windows at this out of the box, and much more customisable.
This is so, so annoying. Your Mac app’s window is minimized? No alt-tab for you!
But, OFC, both WindowMaker and Mac OSX come from the same NeXT grandaddy...
I regularly minimize some applications when I want to focus on others.
There are a bunch of third party tools you can use though, [AltTab](1) is free and tries to replicate windows experience on Mac. [Raycast](2) has a Switch Windows command which also allows direct access to any window via the keyboard (bind to alt+tab if you like) amongst many other features.
[1] https://alt-tab-macos.netlify.app/ [2] https://www.raycast.com/
I did come up with Ghostty bindings to replicate my tmux settings if it helps anyone (my tmux leader is ctrl + space):
I went back to tmux and basic terminal because it works everywhere, and composing tools is just more durable overall.
> Goals … Do not reimplement tmux and his comrades.
( From https://st.suckless.org/goals/ )
Unfortunately, my conclusion was that the only independent character-based terminal tradition is IBM’s 3270 stuff, but even setting aside IBM weirdness it’s simply not that. (Yes, there’s also such a protocol within tmux but it’s not really compatible with anything else.)
Start thinking of tmux, screen, ssh, etc as terminal emulators, and everything will suddenly make sense.
> perhaps we should rethink protocols etc to make many of these features more native
I've been opposing terminal emulators (NOTE: emulators, not REPLs) for a long while. I also do believe we can collectively do better than emulating 1970s hardware. I do believe we can build applications where "ctrl-c" means copy, and selecting more than one screen's worth of text is possible. It's not hard, we're just stubborn.
but i agree with your general point: we can collectively do better than emulating 1970s hardware
absolutely!
VT102 wasn't designed with multiplexing in mind. The device was meant as a primary way to interact with a computer, not to perform the tasks of one - your physical keyboard also doesn't understand "copy".
> selecting more than one screens worth of text is possible in gui terminals and also in tmux.
It is but it isn't. You want to copy a multiline snippet of code you just wrote, you will have to manually strip away $PS1 & $PS2. You want to copy from vi into another window, you can't use the mouse - and you have to use a side channel.
I have 20+ unfixable issues outlined, and I'm in the process of writing a blog post... But at my current rate, it could become a book.
ok, yes, i was just talking about the simple case. you are right that the issue is more complicated, so i actually agree with you. i am talking about similar problems here: https://news.ycombinator.com/item?id=44757142
i am looking forward to your post. i added your blog to my rss reader
Would love some good C developers helping the Screen people.
The primary usecase I've had for it is I can kick off 1 or multiple long running jobs, exit, and then come back later and checkout the various stdout logs to see how it worked.
Could I accomplish the same thing with a bunch of stdout pipes, disown, fg, ctrl-z, etc? Sure. However, tmux makes it really easy to do that and then quickly switch around sessions to see how things are going.
In the simplest workflow, it looks like this
and later to checkout and see what's gone on with the command long after I disconnected with ssh.https://www.masteringemacs.org/article/replacing-tmux-gnu-sc...
The below is fixed (https://github.com/shell-pool/shpool/pull/213/files) upstream already, but is pending a release.
I never heard of shpool, so just tried it. shpool completely breaks my PROMPT_COMMAND because it assumes that each word (in the shell sense) is a separate command. My PROMPT_COMMAND included "history -a" thus causing it to run "history" and "-a" on every prompt, making things quite unusable.
It's quite maddening because all they had to do was write a lot less code to fix it:
Would run the old prompt command just nicely instead of the much longer:I have actually seen this before, in the very fun but silly and not-particularly-useful edex-ui thing. (great way to impress people who don't know, but like, if you type your password in it it literally shows the keystrokes)
https://github.com/GitSquared/edex-ui
I use it a bit with remote connections, but tmux is basically my IDE for development. I have the backtick mapped as my prefix and I hope between terminals and Neovim, and I am considerably less productive when I don’t have this setup.
Sometimes, the old ways are better. A lot of times, actually.
My workflow is project oriented, and I have to juggle multiple projects. So I wrote a small script to let me quickly either attach to an existing dtach session for a project by name, or to start a dtach+nvim session for a project.
Also included some fun wildcarding, so I didn't have to type the full name of the project out, could just type some letters and hit enter.
https://github.com/jauntywunderkind/dtachment
I don't see change as likely, but it does strike me as absurd that although I had gotten rid of tmux as a redundant window management system, I still had both the OS and nvim's window management going. The author talks about how things would work over ssh, but ideally to me, I could ssh in, forward some ports, and start some new terminal emulators that open multiple nvim clients that attach to a persistent perhaps headless nvim session.
It's also nice to be able to re-connect and be able to resume a session without having to reopen many terminals, which you would lose with the lack of window management.
set -s copy-command 'xsel -i'
But, I am not an uber-elite-geek and Zellij is a good enough compromise to me.
It gives me the things I am too lazy to solve by myself like tmux, with a lot less pain points.
WezTerm is not necessarily something I want to deploy and keep up to date on hundreds of machines, screen/tmux are still fine for that.
Also, if you do physically connect to a headless machine, it's nice to not need to keep having to open a new getty session (or be able to log out of a session) ;)
the key benefit is i only need to learn one set of commands to switch sessions and windows, and to create new windows.
the sessions all run in a single terminal window, so when i have multiple other windows, i don't have to switch between them to find the right terminal window. terminals have tabs, but they don't group tabs into sessions. a single terminal with 19 tabs would not work.
i use the gui to start the terminal. i would have to find out how to script starting a terminal with multiple tabs. tmux is more easily scriptable, and again, i can't avoid learning tmux, since i use it remotely, and so when using it locally too, i don't have to learn a different way for my local machine.
finally, although rarely needed, i can log out, or my gui can crash, but the tmux sessions survive. i can also connect to my laptop from a different device and attach to the tmux sessions that way.
for a gui terminal to replace tmux the foremost feature i need is for it to remember my windows and tabs, just like the browser does. i have not come across any terminal that does that (but i admit, i haven't done a exhaustive search either). gnome (or any WM) can remember which apps i have open, but it can't remember the state inside the apps.
being able to reproduce state is really the key. i have a few vim sessions for example, easily remembered and recalled from my command line history. i could use gvim if i could figure out how to connect a gvim window with a terminal such that they form one unit, because every vim session is connected a number of commandline operations. (i believe BeOS/haiku can potentially do that based on the way its window tabs work)
Any particular reason why you cannot simply use su or sudo for this?
I don't use a tiling WM, and tmux[1] does an excellent job at the tiling features.
I do the majority of my work physically at a Linux (Fedora) desktop, but I also work from home SSH'd to that desktop. Being able to just attach to the same session and pick up where I left off, with all the same shell management, is great.
[1] I used tmux for years, but have very recently switched to Zellij. I find the pane navigation to be much smoother (and more discoverable).
- https://github.com/MLFlexer/smart_workspace_switcher.wezterm
- https://github.com/MLFlexer/resurrect.wezterm
I generally have a single session I care about per machine (rather than per project) and wezterm's built-in multiplexing handles this out of the box.
Otherwise complaining about tmux and talking about hacky workaround alternatives is a bit like complaining about the internet and advocating for the telegraph as a hacky alternative because you don't like writing your own HTTP requests by hand and morse code is so much simpler.
Having said that, if really all you want is pane splits / window management, lots of terminals have their own solutions for this. Guake is a good one.
disclaimer: I use Guake and still prefer to just use tmux (byobu) from Guake
https://wezterm.org/multiplexing.html
1. zoom-pane (temporarily make one pane be the only pane) (also can someone please add this to vscode!)
2. keybindings to navigate focus between panes according to their layout positions
3. ability for another process to programmatically change which terminal window has focus, and window naming
I think that's it. Could probably hack most/all of that together with hammerspoon I guess. I don't use it for persistence, and I certainly don't like the scrollback UX. It has got in the way from time to time, principally with its slow adoption of hyperlinks. But I'm general it's been a huge win for years.
It is also extensible.
If there's a better way, I'm open to it. As of right now Claude can't vibe code me a script that opens two ghostty tabs, so tmux it is
But I agree that tmux sessions are convenient.
AFAIK this doesn't exist, so I'm using tmux...
So terminal clients just have to implement this protocol... it's already implemented in iTerm2
This isn't about reinventing tmux poorly. They're trying to keep their workflow without having a muxer in the middle that needs to understand and translate every feature of the protocol, which is the core concept and the major problem with tmux.
If you do splits client side, you don't have any software middlebox trying to interpret the traffic, so you keep native scrollback and all the fancy features of your terminal are still here.
That's what the blog post is about. Not reinventing tmux, but getting rid of the muxing.
But I also take issue with statements like "terminal multiplexers are a bad idea, do not use them, if at all possible" (from the kitty FAQ and the YouTube video linked in the article). Tmux solves a number of real problems for me that Kitty doesn't. Kitty also seems to be moving in a direction that I am not interested in. It's tied to a windowing system when I want a terminal that I can use headless. Even with the hacky workarounds the article mentions, it doesn't really support session persistence when I use this feature of tmux weekly. It introduces a lot of features that are likely to lead to visual noise when the constraints of text-only are one of the main reasons I like terminals (personally I don't want images in my terminal, full stop).
Now, all of this is fine. It's the other statement, "[tmux acts] as a drag on the ecosystem as a whole, making it very hard to get any new features," that causes it all to rub me the wrong way. The only reason you feel like tmux acts like a drag is because there are users like me who won't switch to something like Kitty if it doesn't support tmux. So don't worry about us. Build a new thing that is not backwards compatible and live with the fact that many people won't use it. If you really want to drive the ecosystem forward as a whole, be less condescending about real use-cases that bring benefit to real users.
To be clear (because text is a limited medium), I'm not grumpy, angry, or against Kitty because of this. But I am dismissive.
I liked the fact I didn't need to set anything up for Zellij and could gradually add stuff
The session persistence thing is still best solved with tmux, however, I don't ever need this. Nohup is sufficient for long running commands where my ssh might fail. I don't really find myself sshing into a machine and then setting loads of env vars that I need to persist.
kovid is talking about how tmux gets in the way of terminals adding new features. i agree with that, but what about the features that tmux offers that i have yet to see in any gui terminal. (multiple sessions. the ability to connect to the same session from multiple terminals. scriptability, including sending characters into a terminal. splitting windows into multiple panes...)
can kitty do any of those? if you want to add features to the terminal, then you have to content that tmux does as well, and maybe tmux features are more interesting to me than kittys. so if you want to win me over, then you have to actually implement some of the features of tmux that i use.
(watching the interview, it looks like kitty does indeed implement some of tmux features, because interestingly the interviewer asks just the right questions. but i need to look for a more comprehensive introduction to see how kitty can replace tmux locally.)
I've switched to abduco for persistance and use neovim for window management (both vim and neovim have a built in terminal emulator). Using vim keybindings for managing windows and tabs is more natural, I can copy/paster just normally and you even get some perks like `gf` to quickly open a filepath under the cursor.
But I really want Vim to color properly in it, can anyone give me the right solution?
https://vim-jp.org/vimdoc-en/options.html#'termguicolors'
I dont see this as an issue though. Terminals are pretty much a solved problem, they dont need any new features. IMO it makes more sense to spend effort on improving tmux<->terminal interop rather than adding fancy graphics protocols that we dont actually need.
so no, terminals are not a solved problem.
i can select a column in tmux too, using tmux commands, and then it's the same problem. i can't use that selection outside of tmux.
i simply want the GUI to be aware that there are multiple columns in the terminal and let me select text within one using the mouse and then copy that to a different window/app.
I'm still a gnu screen guy, but for me the trade-off is still in favour of screen/tmux.
1. Having to zoom a window before copying multiple lines of text (Kovid brought this up in the interview that was mentioned in this article)
2. The weirdness of copying text from the scrollback buffer into the clipboard
I've tried so many things for the second one over the years. I think I have it working okay-ish these days. But there are still plenty of times that I say, "aw screw it", and literally use the terminal's copy command.
Every other solution to my multi-terminal workflow have been worse though! i3/bspwm with multiple terminals were okay. It was just hard to have "projects". I'd have to visit each terminal and switch to the proper directory, launch servers/docker-compose/etc.
Zellij felt like too much "hopping out into manipulation mode, manipulating, then hopping back into work mode". Those milleseconds were enough to halt my flowstate.
Single terminal with built-in tabs/splits felt clunky as I couldn't get the keyboard shortcuts into muscle memory (perhaps more time would help)
Also, tmux new-window does wonders with software spawned from sfeed, sacc and who knows how many TUI/CLI tools.
You open your RSS feed list with sfeed, read the whole page with C under 'less', and if there are images, you can spawn Links in another page with 'o'.
I have similar setups for various projetcts and do not need to manually start services, tools, whatnot. With `mx projectx` everything is started within seconds.
And navigating panes and windows is super easy with the proper shortcuts (opt+h,j,k,l), even across tmux and nvim.
Why would I give up on that?
Then it is a pragmatic decision, using tmux you get to use the ecosystem of things like tmuxinator which explicitly target tmux to get a known number of terminal features like splits. What I learn from the OP, is that there are technical reasons that tmux is not a "good design" - like Kovid's comments on how it constrains innovation in terminal designs - which might lead someone to consider, what actually does tmux do and could my workflow be implemented otherwise?
It might be a bunch of unixy hacks and tricks (as another commenter here said) but it can work. I'd imagine recreating something like tmuxinator would be hard though, but it could also be interesting, like having arbitrary GUI programs configured to appear in "splits" using tiling integrated seamlessly within the terminals. But yeah, if the workflow is already set up and serviceable and supported with a community, using tmux, then I'd just keep using it.
The rest the Operating system applications can probably do better anyway. VLC, MPV, Apple Preview IrfanView etc.
That's why I love Alacritty, no fuss, no overcomplication. The basics, fast and stable.
So, if your multiplexer lacks support for certain features, it will limit functionality in advanced terminals like Kitty or Ghostty.
It’s just too bad I suffer from a lack of common sense and insistence on trying to believe that all archaic terminal text based tools are better than anything else. I’m a developer and developers have insight on the best UI and we know that terminals are better than anything in the known universe. If you use a mouse you’re an ass hole.
Useful debate on the merits of anything is a pointless endeavor because all varying opinions are valid. There is no best, better or worse… just everyone’s freedom of opinions.
In my opinion eating lead is good for you and using a mouse and clicking on tabs hinders my efficiency by 300 percent. That’s my opinion! And it’s valid! I am valid!
Tmux is good when you have no gui.
But all this endless getting square pegs to fit in a round hole is what causes the snarks. Like you want to draw windows? Let’s use terminal characters instead of lines! Makes perfect sense.
I find it incredulous that a lecture had to get this guy to realize what’s wrong with tmux and he still doesn’t see that this problem can be avoided by using a gui. He still goes for terminal abstractions.
GUI is an obvious solution. But this guy is blind.