終端機管理工具 tmux

看到 MIS 大大在公司的伺服器上安裝 tmux,因為好奇而開始試用。把這幾天學到的 奇怪的 知識紀錄下來。

華麗的 tmux 環境

原本就習慣使用 GNU screen 來管理連線,使用 tmux 的邏輯大概相同,很快就能上手,主要是熱鍵和設定上的差異需要時間熟悉。

tmux 的按鍵組合和 sreen 一樣都是先按 prefix,再接指令,但 screen 的 prefix 是 Ctrl+a,而 tmux 卻是相當不順手的 Ctrl+b,這個可以用以下 config 去調整。

tmux configuration

tmux 的設定檔名為 tmux.conf,檔案放置在 ~/tmux.conf 即可。

我目前只簡單地放了啟用幾個功能

# prefix setting (screen-like)
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# enable mouse<
setw -g mode-mouse on

# allow mouse to select windows and panes
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on

tmux reload configuration

修改完 tmux.conf 後如何讓設定檔立即生效,按下 <prefix> 後接著輸入 :source-file ~/.tmux.conf

參考資料

Tmux Cheat Sheet & Quick Reference

Making tmux Pretty and Usable – A Guide to Customizing your tmux.conf

少年沒帶腦: Reload tmux config

終端機管理工具:tmux

gpakosz / .tmux


Posted

in

, , ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *