tmux command

I’ve started using tmux instead of screen lately. My version of screen (no longer maintained) doesn’t do vertical window splits where tmux does.

Just like screen I use backtick as my C-a. Backtick-c will create a new window. Backtick-d will disconnect the sessions. The command “tmux attach” will re-attach to my sessions and it remembers all my window splits which I never could do in screen.

Here is my current .tmux.conf cobbled together from google searches.

# Set option key
set-option -g prefix `

# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left "#[fg=green]#H"

unbind % # Remove default binding since were replacing
bind | split-window -h
bind - split-window -v

#set-option -g mouse-select-pane on

bind ` send-keys `
bind e send-keys "smitty etherchannel"
bind a send-keys "netstat -v | grep -i activ"
bind s send-keys "stty erase ^?"

# basic settings
set-window-option -g mode-keys vi # vi key
set-option -g status-keys vi
set-window-option -g utf8 on # utf8 support
set-window-option -g mode-mouse off # disable mouse

# copy mode to escape key
unbind [
bind Escape copy-mode

set-option -g mouse-select-pane off

# window title
set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on # auto name

# messages
#set-window-option -g mode-bg magenta
#set-window-option -g mode-fg black
#set-option -g message-bg magenta
#set-option -g message-fg black

# No visual activity
set -g visual-activity off
set -g visual-bell off

# status bar
set-option -g status-utf8 on
set-option -g status-justify right
set-option -g status-bg black
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g status-left-length 30
set-option -g status-left '#[fg=magenta]> #[fg=blue,bold]#T#[default]'
set-option -g status-right '#[fg=cyan]>> #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
set-option -g visual-activity on
set-window-option -g monitor-activity on
set-window-option -g window-status-current-fg white

# clock
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 24

And this is what one of my tmux screens look like: –

About

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Private

One thought on “tmux command

%d bloggers like this: