Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
tmux
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jason Lotito
July 30, 2015
Programming
50
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
tmux
Jason Lotito
July 30, 2015
More Decks by Jason Lotito
See All by Jason Lotito
Getting Things Done from Someone with OCD & ADHD
jasonlotito
0
95
How We Killed Our Process, Technology Stack, and Assumptions — and Survived
jasonlotito
0
58
Twitter Bootstrap, or why being a PHP Developer is a bad idea.
jasonlotito
2
570
require.js
jasonlotito
3
100
Command Line PHP Basics
jasonlotito
1
65
tmux
jasonlotito
0
150
Other Decks in Programming
See All in Programming
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
900
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
180
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
A2UI という光を覗いてみる
satohjohn
1
150
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
910
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
800
Oxlintのカスタムルールの現況
syumai
6
1.1k
ふつうのFeature Flag実践入門
irof
8
4.1k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
WENDY [Excerpt]
tessaabrams
11
38k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Building Applications with DynamoDB
mza
96
7.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
320
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Transcript
tmux Real Ultimate Terminal Power tmux.sf.net Go ahead and install
it and follow along! For Windows users: tmux can be installed under cygwin
quick demo
Jason Lotito Senior Architect @ MeetMe.com @jasonlotito
[email protected]
Slides available
at joind.in/13251
$ tmux
$ tmux new -s test
prefix = CTRL + b This is the default prefix
It’s run before every command prefix d This means type ‘CTRL + b’ and then type ‘d’.
prefix d Detaches from the current tmux session In other
words, it exits tmux
$ tmux ls See sessions running
$ tmux attach reattaches to the last tmux session you
were attached to
$ tmux attach -t test reattaches to session named confoo
prefix c create a new window (or tab)
prefix , Name the window
prefix & Close window, with prompt
demo 1
set renumber-windows Automatically renumber windows on closing Will get to
commands later
prefix # ‘prefix 1’ takes you to window/tab #1
prefix w provides a list of windows available ‘j’ and
‘k’ to scroll the selections
prefix % That’s not 5, but ‘%’, which means prefix
SHIFT+5 This splits the pane in half
prefix “ split horizontally
prefix x kills the active pane In the lower portion
of tmux, you’ll see it ask you: kill pane 2? (y/n) type ‘y’
prefix o switch between panes
prefix SPACE change layout of panes
demo 2
Try scrolling in a pane haha
prefix [ CTRL u: scroll up CTRL d: scroll down
j: up a line d: down a line q: quit mode
prefix ? Help, with also reflects your config
prefix z zoom in on a pane cheap copy/paste
prefix : Open up the tmux command prompt Autocomplete enabled
prefix : set synchronize-panes set sy<TAB> Toggles synchronization on and
off
demo 3
Configuration $ touch ~/.tmux.conf
CTRL + B is awkward # Prefix Config set -g
prefix C-a unbind C-b # C-a x2 to send C-a to bash bind C-a send-prefix
prefix = CTRL + a Remap CAPS LOCK to CTRL.
Make it responsive # Changing the default delay set -sg
escape-time 0
Easy config changes # Easy config changes bind r source-file
~/.tmux.conf \; display "Reloaded!"
Easy Pane Spitting # Splitting Panes bind \ split-window -h
bind - split-window -v
Easy Pane Movement # Movement keys, vim style bind h
select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R
move one pane left prefix h
Pane Resizing # Pane resizing, vim style bind H resize-pane
-L 5 bind J resize-pane -D 5 bind K resize-pane -U 5 bind L resize-pane -R 5
Let’s make resizing easier by repeating # Pane resizing, vim
style bind -r H resize-pane -L 5 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5
resize prefix L -r Means you can hit it repeatedly
without the prefix
Start at 1 # Windows and panes index renumbering set
-g base-index 1 setw -g pane-base-index 1
Basic UI # Colors set -g status-fg white set -g
status-bg black
Window movement # Window Movement bind -r C-h select-window -t
:- bind -r C-l select-window -t :+
or... prefix w
or... prefix # #: 0-9
My Config https://gist.github.com/11405471.git Or, if you download these slides…
# Mac Terminal Support set -g default-terminal "xterm-256color" # Prefix
set -g prefix C-a unbind C-b # Start number at 1 set -g base-index 1 setw -g pane-base-index 1 # Faster command sequences by removing escape time set -s escape-time 0 # Rebind set -g prefix C-a bind C-a send-prefix unbind C-b # Move around panes bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R # Splitting Panes bind \ split-window -h bind - split-window -v bind -r C-h select-window -t :- bind -r C-l select-window -t :+ # Allow us to resize panes bind -r H resize-pane -L 5 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5
teamocil a tmux “addon”
teamocil 0.4.5 1.0 was a rewrite, removing features I loved
tmuxinator also exists
$ gem install teamocil -v 0.4.5 The version I recommend
$ teamocil -e <name> edit the config
1 session: 2 name: "confoo" 3 clear: true 4 windows:
5 - name: "confoo" 6 layout: even-horizontal 7 options: 8 synchronize-panes: true 9 panes: 10 - cmd: "" 11 - cmd: "top" 12 - name: "redis" 13 panes: 14 - cmd: "redis-server"
let’s see it
Another sample file
0 session: 1 name: "consumers" 2 clear: true 3 windows:
4 - name: "consumers" 5 options: 6 synchronize-panes: true 7 layout: tiled 8 panes: 9 - cmd: “ssh consumer1 -t 'sudo su - jenkins'" 10 - cmd: "ssh consumer2 -t 'sudo su - jenkins'" 11 - cmd: "ssh consumer3 -t 'sudo su - jenkins'" 12 - cmd: "ssh consumer4 -t 'sudo su - jenkins'" 13 - cmd: "ssh consumer5 -t 'sudo su - jenkins'" 14 - cmd: "ssh consumer6 -t 'sudo su - jenkins'" 15 - cmd: "ssh consumer7 -t 'sudo su - jenkins'" 16 - cmd: "ssh consumer8 -t 'sudo su - jenkins'" 17 - cmd: "ssh consumer9 -t 'sudo su - jenkins'" 18 - cmd: "ssh consumer10 -t 'sudo su - jenkins'" 19 - cmd: "ssh consumer11 -t 'sudo su - jenkins'" 20 - cmd: "ssh consumer12 -t 'sudo su - jenkins'" 21 - cmd: "ssh consumer13 -t 'sudo su - jenkins'" 22 - cmd: "ssh consumer14 -t 'sudo su - jenkins'" 23 - cmd: "ssh consumer15 -t 'sudo su - jenkins'" 24 - cmd: "ssh consumer16 -t 'sudo su - jenkins'"
tmux & screen notes http://www.mechanicalkeys.com/files/os/notes/tm.html
None
Thanks! Slides at the same URL