I use tmux when SSH'ing to remote boxes, but when working locally I find native terminal panes and tabs to be a better experience. Does tmux provide anything extra to what wezterm/kitty/iterm2 do?
- a tmux session persists on the remote machine, whereas with direct SSH a disconnect loses what you were doing
- a tmux session can be used by multiple people
- with tmux a single command “tmux attach -t someusefulname” restores the layout and all of the commands used, saving a bunch of time and opportunity for error
- tmux has an API, so you can spawn a fully loaded session from scratch with code, rather than by manually doing things or by having a pre-made session (this is soooo underrated, especially if you make it configurable)
Honestly there comes a point where you just redesign the software and have it run in a more automated fashion anyway, but for the odd job that you have to run from time to time it’s very handy to have tmux as a persistent, shareable, configurable scratch space.
You can use the tmux API or a plugin like tmuxp[1] to load a pre-configured session (including running arbitrary shell commands and setting layout).
Using this you could automatically spawn your ssh connections as nested tmux sessions.
Obviously this brings some complications, namely that you need to set different prefix keys (or double press prefix) and any non-prefix hotkeys always get sent to your local session. Personally I just configure remote tmux to have only prefixed keybinds and never make any complicated layouts on remote sessions so that having to press <inner-prefix> + <key> doesn't get annoying.
i-use-nixos-btw|2 years ago
- a tmux session can be used by multiple people
- with tmux a single command “tmux attach -t someusefulname” restores the layout and all of the commands used, saving a bunch of time and opportunity for error
- tmux has an API, so you can spawn a fully loaded session from scratch with code, rather than by manually doing things or by having a pre-made session (this is soooo underrated, especially if you make it configurable)
Honestly there comes a point where you just redesign the software and have it run in a more automated fashion anyway, but for the odd job that you have to run from time to time it’s very handy to have tmux as a persistent, shareable, configurable scratch space.
thworp|2 years ago
Using this you could automatically spawn your ssh connections as nested tmux sessions. Obviously this brings some complications, namely that you need to set different prefix keys (or double press prefix) and any non-prefix hotkeys always get sent to your local session. Personally I just configure remote tmux to have only prefixed keybinds and never make any complicated layouts on remote sessions so that having to press <inner-prefix> + <key> doesn't get annoying.
[1]: https://github.com/tmux-python/tmuxp
0x008|2 years ago
eigenvalue|2 years ago