SlideShare une entreprise Scribd logo
1  sur  31
TMUX
Development workflow
What does it do?
Multiple panes
Multiple windows
Multiple sessions
…we’ll get to that.
Hierarchy
• Sessions contain windows
• Windows contain panes
• Panes contain your junk
Sessions > Windows > Panes
More familiarly…
Benefits
• Available anywhere
• Terminal independent
• Highly customisable
• Sessions are awesome (…we’ll still get to that)
• Integrates well with vim (or emacs, I guess)
Getting started
Install tmux
$ brew install tmux # OS X
$ sudo pacman -S tmux # Arch
$ sudo apt-get install tmux # Debian
$ apt-cyg install tmux # FML
Use tmux
$ tmux # dumps you into a new session
# or, to give your new session a name:
$ tmux new -s foo
Basics
• Interact with commands
• Prefix: CTRL+b
• Command mode: <prefix> :
Windows
• New window: <prefix> c
• Next window: <prefix> n
• Previous window: <prefix> p
• Go to window by number: <prefix> 0..9
• List windows: <prefix> w
• Rename window: <prefix> ,
Panes
• Horizontal split: <prefix> “
• Vertical split: <prefix> %
• Switch pane: <prefix> ← / → / ↑ / ↓
• Go to pane: <prefix> q
Intermission
Let’s customise!
Customising mappings
• You work with windows and panes all the time
• Default key mappings are clunky
• tmux makes it easy to change stuff
• Config file lives in ~/.tmux.conf
Starting point
• http://tiny.cc/licotmux
• Sane defaults (UTF-8, vi-keys, status line)
• Easier splits (C-h/j/k/l, M--, M-)
• Easier window navigation (M-j/k)
• Easier session navigation (M-8, M-9/0)
• Some other junk (but not too much)
Sessions
• Sessions can run headlessly
• Close your terminal (or tab), re-attach later:
tmux attach -t foo
• Quickly switch context
Session persistence
For those rare crashes and reboots
Options
• tmuxinator
https://github.com/tmuxinator/tmuxinator
• tmux-resurrect
https://github.com/tmux-plugins/tmux-resurrect
• tmuxifier (not covered)
https://github.com/jimeh/tmuxifier
tmuxinator
+ Fine-grained control
+ Portable
+ Easy to copy to a similar project
- Awkward to write
- Awkward to change
tmux-resurrect
+ Nothing to write
+ Quick & easy to use
+ Restores vim sessions
+ I prefer it, so you should too!
- Not as portable
- Can’t copy settings from context to context
tmux-resurrect installation
• Install TPM, the tmux plugin manager
https://github.com/tmux-plugins/tpm
• Install tmux-resurrect as a plugin
https://github.com/tmux-plugins/tmux-resurrect
• Just RTFMs.
tmux-resurrect usage
1. Do stuff
2. <prefix> <C-s> # save
3. … PC crashes …
4. Start tmux
5. <prefix> <C-r> # restore
6. Smile :-)
Vim integration
Splits & panes
• Install christoomey/vim-tmux-navigator
https://github.com/christoomey/vim-tmux-navigator
• Move between vim splits and tmux panes with C-
h/j/k/l.
Send command to pane
• Install benmills/vimux
https://github.com/benmills/vimux
• :VimuxRunCommand “foo”
• Check out the GitHub page for related plugins.
Run specs in pane
• Install thoughtbot/vim-rspec
https://github.com/thoughtbot/vim-rspec
• let g:rspec_command = '
call VimuxRunCommand(
"clear && bundle exec rspec {spec}")'
• :call RunNearestSpec()
You gotta map this stuff
nnoremap <leader>sf :call RunCurrentSpecFile()<CR>
nnoremap <leader>ss :call RunNearestSpec()<CR>
nnoremap <leader>sl :call RunLastSpec()<CR>
nnoremap <leader>sa :call RunAllSpecs()<CR>
I think that’s about it.
Other stuff
tmux-continuum
Automates restoring tmux-resurrect sessions
https://github.com/tmux-plugins/tpm
tmux-cheatsheet
Great list of mappings. Also try <prefix> ?
https://gist.github.com/MohamedAlaa/2961058
Consider remapping prefix
What if you’re running tmux over ssh in tmux?
Slides
http://www.slideshare.net/jschembri/tmux-development-workflow

Contenu connexe

Tendances

Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!Kent Chen
 
2016 nov-16 grenoble-floss_tmux
2016 nov-16 grenoble-floss_tmux2016 nov-16 grenoble-floss_tmux
2016 nov-16 grenoble-floss_tmuxMichael Bright
 
tmux20141007
tmux20141007tmux20141007
tmux20141007Kevin Wu
 
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokdenn|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
n|u Dharamsala Humla : Memory Forensic by Tenzin ChokdenSunil Kumar
 
Compiladoresemulador
CompiladoresemuladorCompiladoresemulador
CompiladoresemuladorDavid Caicedo
 
Improving your shell usage - 2009
Improving your shell usage - 2009Improving your shell usage - 2009
Improving your shell usage - 2009Chris Sinjakli
 
Remote pairing from the comfort of your own shell
Remote pairing from the comfort of your own shellRemote pairing from the comfort of your own shell
Remote pairing from the comfort of your own shellevanlight
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstJawad Khan
 
Adding System Call to Kernel
Adding System Call to KernelAdding System Call to Kernel
Adding System Call to KernelMuhammad Bilal
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Installing symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPInstalling symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPRiyad Bin Zaman
 

Tendances (17)

Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!
 
2016 nov-16 grenoble-floss_tmux
2016 nov-16 grenoble-floss_tmux2016 nov-16 grenoble-floss_tmux
2016 nov-16 grenoble-floss_tmux
 
tmux20141007
tmux20141007tmux20141007
tmux20141007
 
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokdenn|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
 
Compiladoresemulador
CompiladoresemuladorCompiladoresemulador
Compiladoresemulador
 
Improving your shell usage - 2009
Improving your shell usage - 2009Improving your shell usage - 2009
Improving your shell usage - 2009
 
Remote pairing from the comfort of your own shell
Remote pairing from the comfort of your own shellRemote pairing from the comfort of your own shell
Remote pairing from the comfort of your own shell
 
Installation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling firstInstallation of ubuntu, ns3 and compiling first
Installation of ubuntu, ns3 and compiling first
 
Unix
UnixUnix
Unix
 
Daemons in PHP
Daemons in PHPDaemons in PHP
Daemons in PHP
 
Adding System Call to Kernel
Adding System Call to KernelAdding System Call to Kernel
Adding System Call to Kernel
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Using strace
Using straceUsing strace
Using strace
 
linux_distro
linux_distrolinux_distro
linux_distro
 
Installing symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPInstalling symfony within netbeans and WAMP
Installing symfony within netbeans and WAMP
 
Ubuntu Terminal
Ubuntu TerminalUbuntu Terminal
Ubuntu Terminal
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
 

Similaire à Tmux Development Workflow

Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginnersNitesh Nayal
 
Ultimate tools for developers
Ultimate tools for developersUltimate tools for developers
Ultimate tools for developersHarjot Mann
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeMatt Ray
 
Linux container internals
Linux container internalsLinux container internals
Linux container internalsAshwin Bilgi
 
Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Ahmed El-Arabawy
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linuxMazenetsolution
 
202110 SESUG 49 UNIX X Command Tips and Tricks
202110 SESUG 49 UNIX X Command Tips and Tricks202110 SESUG 49 UNIX X Command Tips and Tricks
202110 SESUG 49 UNIX X Command Tips and Tricksdhorvath
 
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible NETWAYS
 
Educational operating system-Minix&Weenix
Educational operating system-Minix&WeenixEducational operating system-Minix&Weenix
Educational operating system-Minix&WeenixStudent
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)Masami Hiramatsu
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxQIANG XU
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Jérôme Petazzoni
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsAll Things Open
 
Introduction To Unix.pptx
Introduction To Unix.pptxIntroduction To Unix.pptx
Introduction To Unix.pptxssuser140ea3
 

Similaire à Tmux Development Workflow (20)

Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Small Screen Development
Small Screen DevelopmentSmall Screen Development
Small Screen Development
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Ultimate tools for developers
Ultimate tools for developersUltimate tools for developers
Ultimate tools for developers
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
 
Emacs tutorial
Emacs tutorialEmacs tutorial
Emacs tutorial
 
Linux container internals
Linux container internalsLinux container internals
Linux container internals
 
Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
202110 SESUG 49 UNIX X Command Tips and Tricks
202110 SESUG 49 UNIX X Command Tips and Tricks202110 SESUG 49 UNIX X Command Tips and Tricks
202110 SESUG 49 UNIX X Command Tips and Tricks
 
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
OSDC 2014: Jan-Piet Mens - Configuration Management with Ansible
 
2004 ugm-tips-tricks
2004 ugm-tips-tricks2004 ugm-tips-tricks
2004 ugm-tips-tricks
 
Educational operating system-Minix&Weenix
Educational operating system-Minix&WeenixEducational operating system-Minix&Weenix
Educational operating system-Minix&Weenix
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
Linux Day2
Linux Day2Linux Day2
Linux Day2
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS Tools
 
Introduction To Unix.pptx
Introduction To Unix.pptxIntroduction To Unix.pptx
Introduction To Unix.pptx
 

Dernier

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Dernier (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Tmux Development Workflow