linux_wiki:tmux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
linux_wiki:tmux [2015/03/18 19:06]
billdozor [Panes]
linux_wiki:tmux [2018/03/07 09:17]
billdozor [Tmux Config File]
Line 6: Line 6:
  
 **Checklist** **Checklist**
-  * DistrosAll+  * Distro(s)Any
   * Package: tmux   * Package: tmux
  
 ---- ----
  
-===== Install =====+====== Install ======
  
 Install tmux: Install tmux:
Line 22: Line 22:
 ---- ----
  
-===== Tmux Operation =====+====== Tmux Operation ======
  
 1) Open a terminal 1) Open a terminal
Line 33: Line 33:
 ---- ----
  
-==== Session Control ====+===== Session Control =====
  
 Start a named tmux session Start a named tmux session
Line 62: Line 62:
 ---- ----
  
-==== Windows ====+===== Windows =====
  
 Like screen, tmux has windows. Like screen, tmux has windows.
Line 89: Line 89:
 ---- ----
  
-==== Panes ====+===== Panes =====
  
 An advantage that tmux has over screen, is the ability to create panes. An advantage that tmux has over screen, is the ability to create panes.
Line 129: Line 129:
 Ctrl+b ESC+1 Ctrl+b ESC+1
 </code> </code>
 +
 ---- ----
  
-==== Copy/Paste with Keyboard ====+===== Copy/Paste with Keyboard =====
  
 Enter copy mode Enter copy mode
Line 140: Line 141:
 **While in copy mode** **While in copy mode**
  
-Move around: arrow keys +  * Move around: arrow keys 
-Start selection: space +  Start selection: space 
-Copy selection: enter+  Copy selection: enter
  
 Paste selection Paste selection
Line 149: Line 150:
 </code> </code>
  
-==== Other Commands ====+===== Other Commands =====
  
 Help Help
Line 160: Line 161:
 Ctrl+b :list-commands Ctrl+b :list-commands
 </code> </code>
 +
 +----
 +
 +====== Tmux Config File ======
 +
 +You can customize tmux with a config file in your home directory.
 +
 +The following is a running list of customizations I find useful.
 +
 +~/.tmux.conf
 +<code bash>
 +# use the vim motion keys to move between panes
 +bind-key h select-pane -L
 +bind-key j select-pane -D
 +bind-key k select-pane -U
 +bind-key l select-pane -R
 +
 +# set history scroll back size (default is 2000, also set terminal scroll back to be >= )
 +set-option -g history-limit 5000
 +
 +# start window index at 1 instead of 0
 +set -g base-index 1
 +
 +# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
 +set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
 +
 +# Set default shell
 +set-option -g default-shell /bin/zsh
 +
 +# Mouse wheel scrolling for individual panes (newer versions of tmux; ie Fedora 27)
 +set -g mouse on
 +bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
 +
 +# Mouse wheel scrolling for individual panes (older versions of tmux; ie CentOS 7)
 +set -g mode-mouse on
 +</code>
 +  * **Notes:**
 +    * With certain mouse options in tmux, the ability to highlight text as normal for a copy/paste operation goes away.
 +    * To copy/paste
 +      * **hold shift**, select text, copy
 +      * **hold shift**, right click, paste (or middle click)
 +
 +----
 +
 +====== Tmux Aliases ======
 +
 +Some useful tmux aliases from ~/.bashrc
 +<code bash>
 +# Tmux Aliases
 +alias tls='tmux list-sessions'
 +alias tat='tmux attach -t'
 +alias tns='tmux new -s'
 +</code>
 +
 +----
  • linux_wiki/tmux.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)