wazzat?!
tmux is generally a replacement for the aged
screen utiility i've used for so long.
tmux is developed by the openbsd team, and for that reason alone can probably be recognized as being written better/cleaner/safer. but it also provides a host of options that have been missing in
screen - not the least of which is split screens. the one and only thing i use
screen for that
tmux doesn't provide is a connection to a serial console.
quickstart
a fairly detailed/friendly howto is:
HERE
- start a new session with tmux
- give this session a name with the command <CTRL-a> :rename-session edi-stuff
- give this window a name with <CTRL-a> ,
- create a new window with <CTRL-a> c
- give this new window a name as well
- create a new session: <CTRL-a> :new-session
- give this session a name as well
- create a few windows and assign names in this session
hints
- create/name sessions for specific tasks (eg. edi-stuff, warmsite-vpn, etc.)
- group related windows in those sessions (eg. in warmsite-vpn session, have windows for nvwsvpn1, evpn1, etc.)
- choose between sessions with <CTRL-a> s
(0) syslog: 8 windows [160x44]
(1) edi-stuff: # windows [209x77]
(2) warmsite-vpn: # windows [103x37]
(3) serialstuff: 9 windows [103x37]
(4) fooey: # windows [103x37] (attached)
- in a given session, choose between windows with <CTRL-a> w
(0) 0: nvwsvpn1* [103x37] (1 panes) "ssh://nvwsvpn1"
(1) # nvwsvpn2# [103x37] (1 panes) "ssh://nvwsvpn2.essent.us"
(2) 2: efwext1 [103x37] (1 panes) "ssh://efwext1"
(3) 3: bash# [103x37] (1 panes) "prl"
(4) 4: efwext1 [103x37] (1 panes) "ssh://efwext1"
(5) 5: wswsvpn1# [103x37] (1 panes) "\\u@\\h:\\w"
(6) 6: wswsvpn2# [103x37] (1 panes) "\\u@\\h:\\w"
(7) 7: man# [103x37] (1 panes) "prl"
(8) 8: evpn1 [103x37] (1 panes) "ssh://evpn1"
(9) 9: pflogs# [103x37] (4 panes) "\\u@\\h:\\w"
(a) # : efwext1# [103x37] (1 panes) "ssh://efwext1"
(b) # : ping# [103x37] (1 panes) "prl"
(c) # : bash# [103x37] (1 panes) "\\u@\\h:\\w"
roll-yer-own config
you don't need to do
anything to get started - just execute
tmux in your shell. to change a few of the defaults (to mimic the default
screen configuration) just copy/paste the following into your very own
~/.tmux.conf file:
# Set the prefix to ^A for those accustomed to using the screen utility.
unbind C-b
set -g prefix C-a
bind a send-prefix
# reload config
bind r source-file ~/.tmux.conf
# last window
bind ^A last-window
# screen splitting
unbind %
bind | split-window -h
bind _ split-window -v
# Set status bar/theme
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
set-window-option -g window-status-current-bg red
setw -g monitor-activity on
# some of the double-binds below are for those of us who are lazy and
# would prefer to continue holding the CTRL key while pressing the command key
# screen ^C c
unbind ^C
bind ^C new-window
unbind c
bind c new-window
# detach ^D d
unbind ^D
bind ^D detach
use my hosted config
{i} you'll need the
fossil command installed to access this archive, so you might not be able to perform this without first installing another piece of software. but then again if you check out
fossil, you might just find another utility so useful that you won't know how you got along without it. :)
- pulling down the archive
mkdir ~/fossils
cd ~/fossils
fossil clone https://www.deweyonline.com/fossil/tmux-config tmux-config.fossil
- unpacking the archive
mkdir ~/.tmux-config
cd ~/.tmux-config
fossil open ~/fossils/tmux-config.fossil
- making the configuration permanent
cd ~/.tmux-config
cp .tmux.conf-example ~/.tmux.conf
- pulling down configuration updates
cd ~/.tmux-config
fossil pull
notes