tmux Configuration / Ubuntu, macOS Environment
1. tmux Installation
1.1. Ubuntu
$ apt install tmux
$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmInstall tmux using apt.
1.2. macOS
$ brew install tmuxInstall tmux using brew.
2. tmux Configuration
| |
Create/modify the ~/.tmux.conf file with the content from [File 1].
3. Bash Shell and Terminal Configuration
3.1. Ubuntu
| |
Add the content from [File 2] to the end of the ~/.bashrc file to configure tmux to run when the shell starts.
3.2. macOS
![[Figure 1] tmux autorun setting with iTerm2](/blog-software/docs/record/tmux-installation-ubuntu-macos/images/tmux-autorun-iterm2.png)
[Figure 1] tmux autorun setting with iTerm2
Preferences... -> Profiles -> General -> Sends text at start:
tmux ls && read tmux-session && tmux attach -t ${tmux-session:-default} \|\| tmux new -s ${tmux-session:-default}
Configure iTerm2 settings as shown in [Figure 1] by adding tmux configuration to “Sends text at start” so that tmux runs when iTerm2 starts.
![[Figure 2] tmux clipboard setting with iTerm2](/blog-software/docs/record/tmux-installation-ubuntu-macos/images/tmux-clipboard-iterm2.png)
[Figure 2] tmux clipboard setting with iTerm2
Preferences... -> General -> Applications in terminal may access clipboard
Configure iTerm2 as shown in [Figure 2] so that text selected in tmux is copied to the clipboard.
4. TPM (Tmux Plugin Manager) Installation and Execution
$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmInstall TPM.
# tmux
ctrl + b, IRun tmux and press the shortcut keys inside tmux to install plugins.