I’ll give the tmux -CC a go when I’m back at my machine, but what else does the integration do? I’m a heavy pane user - does the default split pane in tmux mode use tmux splitting for example?
- genuine fullscreen mode, not the crazy Apple thing where you try to fullscreen an app and it creates another "workspace" or "desktop" or something and you can no longer switch efficiently between fullscreened and non-fullscreened apps without seeing some sliding animation.
- Powerful keybinding support for simple and sophisticated cases. E.g. I use the "send raw bytes" feature so that I can switch panes in tmux with a single keypress, without needing to explicitly send the tmux prefix key. And all that sort of configuration can be version controlled in JSON (you certainly wouldn't want to get something like that working and then commit it to an app config dialog for safe keeping)
- settings for everything
- "dynamic profiles" You can version control your config as JSON
- configurable click behavior ("smart selection"). See other subthreads in this discussion.
- color themes and convenient color switching
Probably others.
With respect, I believe you're making a mistake. Check out some of the things I mentioned. (What does Terminal.app give you over iTerm2?)
Last time I tried this (which, admittedly was sometime back), I found that this was ugly as heck if one has multiple screens and them set to be above one another-ish (e.g. on laptop with desktop screen(s) offset above) - it turns out that iTerm was just sliding the window in from 'offscreen', which if one has windows as I do, means it appears on an upper window.
It's slick if your screens are in 'acceptable' positions for iTerm - otherwise it's an ugly mess. Which is a shame, because I quite like / want this feature.
(Not that Terminal offers this at all mind)
@jimsmart Yes I can believe that might take a bit of tweaking to get right. The author (George Nachman) is very responsive though, so I'm sure he'd appreciate the report. It might be reported/fixed/discussed already?
Ease. I've been down many a custom-config-rabbit-hole but these days I find greater pleasure in paths of least resistance. I'll admit, however, that I love my hyper key and BetterTouchTool gestures.
Saves a bunch of time!
It checks if the remote has tmux first though:
function ssht() {
/usr/bin/ssh -t "$@" "which tmux 2>&1 > /dev/null && tmux -u -CC new -A -s default"
}
alias ssh=sshtwhy do I get: Can't open user config file <user@host-redacted>: No such file or directory
I grabbed it out of a bigger script that also generates and uses an SSH config file. Looks like I pulled out the actual file from args, but not the -F.
ssh user@hostname -Ct 'sh -l -c "exec tmux -CC -u new-session -AD -s remote"'pane 1: ssh <server>-1
pane 2: ssh <server>-2
pane 3: ssh <server>-3
pane 4: ssh <server>-4
function cluster_ssh() {
# Start a pane for every server
for server in $*; do
tmux split-window ssh $server
done;
# Same input to all panes
tmux setw synchronize-panes on;
# Init pane to background, tile layout
tmux break-pane -s 0 -d
tmux select-layout tiled
}
bash# cluster_ssh server-{01..10}.example.com
EDIT: made it a bit more complete, but you only need split and sync panes IMHO.It doesn't give you anything if you're already comfortable with tmux. But if you want your experience to "feel" more native, it's an awesome tool.
Tmux can be a pretty complex piece of software, but iTerm can basically wrap it all up into a nice package. You don't need to know anything at all about tmux to use iTerm's tmux integration.
If you're SSHed into a server that has tmux installed, try running `tmux -CC` on the server. It'll pop up a new window that looks and feels just like it's running natively (complete with tab support), except it's all tunneled over SSH.
And if you disconnect, you can just reconnect later and your windows will all come back in the same state as when you left them.
I use this one-liner to SSH into a server and reconnect (or start) a tmux session:
iTerm2's tmux integration makes SSH access to remote machines feel almost as native as using your machine locally. It's really a killer feature, and it made iTerm2 worth a donation for me.