tmux
OS Integration
Linux
~/.tmux.conf
set -g mouse on
Clipboard: try out set -s clipboard on and try it out
macOS
Use iTerm2 integration instead of relying on set settings. mouse works fine but clipboard integration is not natural.
In tmuxinator config file (ref):
attach: false
on_project_exit: tmux -CC attach
In iTerm2 settings:
- General
- tmux
- When attaching, restore windows as: Tabs in the attaching window
- tmux
https://iterm2.com/documentation-tmux-integration.html
escto exit tmux keeps the session (and processes within them) running in the background. Rerunningtmuxinator [name]reconnects to it- Check if sessions are running:
tmux ls - To fully quit out of a session in iTerm2 integration mode:
tmux kill-session [name]
Starting a Session
- From scratch:
tmux new -ssessionname - From
tmuxinator:tmuxinator start [projectname]
Managing tmuxinator Projects
- Creating:
tmuxinator new [projectname] - Editing:
tmuxinator edit [projectname]
Commands Within tmux
C-b ?- list key bindingsC-b :- command promptkill-session- quit tmux entirely
- Windows
C-b c- create new windowC-b [0-9]- switch to window by numberC-b &- prompt to kill window
- Panes
C-b %- split horizontallyC-b "- split verticallyC-b Up- switch active pane to pane aboveC-b Down- switch active pane to pane belowC-b x- kill active paneC-b page-up/page-down- scroll within a pane. Pressqto exit scrolling modeC-b z- toggle zooming active pane to fill whole window
Config
- Reloading:
tmux source ~/.tmux.confwithin a tmux terminal
Slapdash