tmux - an overview of the features of this powerful terminal multiplexer
Post on 13-Jul-2015
110 Views
Preview:
TRANSCRIPT
tmuxv1.9a
Terminal Awsomeness
Before we beginPhones quiet please
Thank you
Today's subjects...
What is tmux?How to control tmuxDemo of significant featuresQuestions from you
Random bits about me
I'm a long time Unix consultantI spend alot of time in terminalsI enjoy using good toolsI like to share good ideas
What is tmux?tmux is a terminal multiplexer
"it enables a number of terminals to be created,accessed, and controlled from a single screen."
Indeed... like GNU screen.
What it can look like
Why use it?
Session persistenceOne connection, multiple sessionsPower... more on that in a minute
What makes it special?
easily and extensively configurablepowerful tilingscripted controlgood documentationactively maintainedclean code --> easy to contributecan be found by Google et al
How does it work?
client --> server --> sessions --> windows --> panes
Time for action
Controlling tmux
and
Basic window management
Controling tmux - 1/5Using the shell
(Notice: Tab completion)
tmux (=tmux new‐session)tmux new‐windowtmux newwtmux list‐windowstmux detach‐clienttmux attach
As you can see... very scriptable indeed.
Controling tmux - 2/5Using the built in command-prompt
(Notice: Command history and tab completion)
newwsplit ‐hrename‐windowprevious‐window
Controling tmux - 3/5Using shortcuts
Prefix Key + Commandkey
C‐a c (create new window)C‐a C‐a (goto last window)C‐a C‐n (goto next window)C‐a C‐p (goto previous window)C‐a 2 (jump to window number)C‐a ‐ (new horizontal split)C‐a , (rename window)C‐a d (detach)
Controling tmux - 4/5Using the mouse
Window selectionPane selectionPane resizingText selection
Cute? Yes.Practical? You decide.
Controling tmux - 5/5Using the config files, lots can be customized.
/etc/tmux.conf$HOME/.tmux.conf
Session intializationLayout and colors of all status bar itemsExtending status bar with shell scriptsKeyboard shortcuts / macrosGeneral behaviour of tmux
Too much to mention here
An example config file
# This is a very simplified tmux config exampleunbind C‐bset ‐g prefix C‐abind C‐a last‐windowbind C‐c new‐windowbind ‐ split‐window ‐vbind \ split‐window ‐hset ‐g status‐right "#[fg=#44ff44]@#H %d‐%b‐%y %H:%M"set ‐g mode‐keys vineww ‐n jodeli
Tiling
Create / SplitNavigateCustom layoutsStandard layoutsRearrangeZoomBreak / JoinDelete / Kill
And last but not least...
Synchronous input!
Buffer manipulation
vi or emacs control modenavigate (always in copy mode)searchselect and copy text (line or block)past buffer (last or selected)save selected bufferrealtime logging to file
ScriptingAn example: Opening a window with multiple ssh connections
Open a new windowCreate 4 panesStart ssh in each paneLog the output of each tile to diskEnable synchronized input
Can also be done on startup to initialize new sessions.
Session sharing
1. Start a tmux session with a given socket path
2. Allow rw access to socket for group/users
3. Other user starts 'tmux attach' using the shared socket
tmux ‐S /tmp/tmux‐shared new
chown 777 /tmp/tmux‐shared
tmux ‐S /tmp/tmux‐shared attach
Monitoring (in)activity
monitor panes for (in)activitymonitor panes for stringschanges on status bar indicates event
Showing tmux stateThere are several commands to show the state of tmux
info : show server status (clients,sessions,windows,panes)show‐options ‐g : show tmux server settingsshow‐options ‐wg : show window settingslist‐commands : show available tmux commandslist‐keys : show bound keyslist‐sessions (ls)
Start tmux ‐v and get a very detailed client log in the startup dir.
and much more...
Cygwintmux is nowadays packaged with Cygwin
and works like a charm.
Documentation
man tmux
tmux.sourceforge.nettmux FAQmany online examples
Summarytmux is...
powerfulflexible
well documented
something you really ought to have in your toolkit
That's all for now.This slideshow is available on
NOTE: Do check out the embedded note ("asides") in this reveal.js slideshow.slideshare.net
Questions?
Thank you!
top related