To me, tmux only makes sense for remote servers. Why would I want to use it for local terminal sessions? Why not just have multiple terminal windows open? And multiple desktops instead of "sessions", etc?
I use tmux with iTerm integration when SSH'd into remote machines, so that my tabs/window layout are preserved on the remote server when I reboot/reconnect.
But why would I need that locally? iTerm already saves my windows and tabs/layout/etc... because I don't close them.
Using tmux locally just seems like extra steps... when should I "actually" close a window, and when should I just detach it? Why is the distinction even important? If I don't want to see a window I can just minimize it, and if I want to actually close it, I can just... do that. Maybe because tmux has nice keyboard combos for doing window arrangement? But couldn't I just set up my window manager to do the same?
Remote servers though, totally makes sense. Sometimes you have to disconnect your SSH session, so that you can reboot your local machine while leaving the session open. tmux is a necessary thing in that regard. But on a local machine, rebooting means I'm clearing all my state anyway, so what would it really mean to "resume" a tmux session?
I saw my manager masterfully move his cursor across his terminal, select some text, and copy it, all without using his mouse, inside tmux. I thought it was cool
I mean I generally consider my self pretty good at vim (people who watch me are generally pretty impressed at least), and I get the draw to using the keyboard for things, but the actual act of highlighting arbitrary text, vim is not particularly good at. And I can't imagine how tmux would be either.
I won’t comment on which is better, but tmux lets you navigate the screen (and history buffer) by searching and vi(1)-like movements which serve me well. To say nothing of being in a situation where there essentially is no mouse...
Tap-tap-tapping your cursor around a row or column at a press is painful. But getting around by searching is often pretty effective - I don't know who wins in a race but it's fast enough not to break my flow.
one of my favorite tmux patterns is "kill it if its running and run it again somewhere else" which uses send keys in a bash script. I'm always knocking up scripts like this
#!/bin/bash
TMUX_SESSION=test
TMUX_WINDOW=QUICK_TEST
# your custom command you want run
COMMAND=~/bin/quick_test
ARGS=$*
tmux kill-window -t $TMUX_SESSION:$TMUX_WINDOW
tmux new-window -t $TMUX_SESSION -n $TMUX_WINDOW
tmux send-keys -t $TMUX_SESSION:$TMUX_WINDOW"$COMMAND $ARGS" C-m
run the script in the terminal/ide you're working/editing. it blinks away on another screen (or another machine entirely eg. raspberry pi monitor in the kitchen) without disrupting your main task.
Portability I guess? And you can get some pretty nice integration with vim or emacs if you live in the terminal. In fact, it’s probably easier to write a few bash functions to dispatch a command to a new pane than it is to tailor a solution to every OS you might use.
iterm’s Tmux setup is fantastic but if you’re switching between Linux and mac and WSL and want a consistent environment, then you’ve got a good reason to set up Tmux to your liking.
> And multiple desktops instead of "sessions", etc?
I don't like multiple desktops; I like being able to switch panes/windows without losing sight of other applications, like editors and browser windows.
I use tmux locally for multiple sessions. Each session has a different development project. You can achieve the same thing with iterm by having multiple iterm sessions I suppose but I like staying inside one terminal.
Personally, I use environment variables inherited by the multiplexer (and then by any shells inside it) to tune my shell to a particular context. There's therefore a useful difference between "give me a new top-level window" in my window manager and "give me a fresh shell in the same context" in my multiplexer.
I use tmux with iTerm integration when SSH'd into remote machines, so that my tabs/window layout are preserved on the remote server when I reboot/reconnect.
But why would I need that locally? iTerm already saves my windows and tabs/layout/etc... because I don't close them.
Using tmux locally just seems like extra steps... when should I "actually" close a window, and when should I just detach it? Why is the distinction even important? If I don't want to see a window I can just minimize it, and if I want to actually close it, I can just... do that. Maybe because tmux has nice keyboard combos for doing window arrangement? But couldn't I just set up my window manager to do the same?
Remote servers though, totally makes sense. Sometimes you have to disconnect your SSH session, so that you can reboot your local machine while leaving the session open. tmux is a necessary thing in that regard. But on a local machine, rebooting means I'm clearing all my state anyway, so what would it really mean to "resume" a tmux session?
Maybe I just don't get it?