tmux

会话管理

tmux                 # 创建新会话
tmux new -s name     # 指定名称创建
tmux ls              # 列出现有会话
tmux attach -t 0     # 按索引重连
tmux attach -t name  # 按名称重连
tmux kill-session -t 0
tmux kill-session -t name

分离会话:Ctrl+bd

窗口与面板

启动鼠标滚动

  1. 查看tmux版本
  # 大写 V
  tmux -V
  1. 编辑 ~/.tmux.conf(没有就创建)。
  # tmux ≥ 2.1
  set -g mouse on

  # tmux < 2.1
  setw -g mode-mouse on
  set -g mouse-resize-pane on
  set -g mouse-select-pane on
  set -g mouse-select-window on
  1. 重新载入配置文件
  # tmux会话中
  tmux source ~/.tmux.conf
Table of Contents