tmux basic usage

basic

session

  • create new session: tmux new -s name
  • detach session: ctrl+b d
  • attach session: tmux a -t name
  • list session: tmux ls
  • kill session: tmux kill-session -t session_id/session_name

window

  • create window in session: ctrl+b c
  • switch window: ctrl+b num
  • delete window: ctrl+b &
  • rename window: ctrl + b ,

panel

  • create new pane in window: ctrl+b shift+'
  • arrange pane: ctrl+b space
  • switch pane: ctrl+b arrow(up, down, left, right)
  • max pane: ctrl+b z
  • delete pane: ctrl+b x

https://linuxize.com/post/getting-started-with-tmux/

Advance hotkey:

https://tmuxcheatsheet.com/

triggle Home/End key:

  • vi ~/.tmux.conf
  • add
bind -n End send-key C-e
bind -n Home send-key C-a
set -g mouse on
  • reload tmux: tmux source-file ~/.tmux.conf

https://stackoverflow.com/questions/18600188/home-end-keys-do-not-work-in-tmux

mouse scroll up/down:

start on bash startup:

  • Simply add the following line of bash code to your .bashrc before your aliases;
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
  exec tmux new-session -A -s my_session_name
fi

https://unix.stackexchange.com/a/113768/362486

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容