Tmux and Tmuxinator ~ Rise of the Machines

24
tmux and tmuxinator rise of the machines

description

Understand how to automate tmux sessions with the ruby gem, tmuxinator

Transcript of Tmux and Tmuxinator ~ Rise of the Machines

Page 1: Tmux and Tmuxinator  ~ Rise of the Machines

tmux and

tmuxinator rise of the machines

Page 2: Tmux and Tmuxinator  ~ Rise of the Machines

I’ll be back.

• tmux is a terminal multiplexer.

• allows you to save the state of terminal sessions and reattach later.

• sessions are persistent and will survive accidental disconnection.

Page 3: Tmux and Tmuxinator  ~ Rise of the Machines
Page 4: Tmux and Tmuxinator  ~ Rise of the Machines

create a session

Page 5: Tmux and Tmuxinator  ~ Rise of the Machines

exit the session

Page 6: Tmux and Tmuxinator  ~ Rise of the Machines

now create a named session

Page 7: Tmux and Tmuxinator  ~ Rise of the Machines

detaching and attaching to sessions

• detach:> C-b

• attach:> tmux attach -t catproof

Page 8: Tmux and Tmuxinator  ~ Rise of the Machines

examining sessions

• create another session and then detach:> tmux new -s humanproof>> C-b d

• show all tmux session:> tmux ls

Page 9: Tmux and Tmuxinator  ~ Rise of the Machines

examining sessions

Page 10: Tmux and Tmuxinator  ~ Rise of the Machines

killing sessions

• kill a session:> tmux kill-session -t humanproof

Page 11: Tmux and Tmuxinator  ~ Rise of the Machines

wait what?

• attach to or kill a session:> tmux attach -t catproof> tmux kill-session -t catproof

• create a session:> tmux new -s cat proof

• yes it’s different flags, -i before e except after c-just remember it..

Page 12: Tmux and Tmuxinator  ~ Rise of the Machines

working with panes

• attach to a session:> tmux attach -t

• split vertically:> C-b %

• split window horizontally:> C-b “

Page 13: Tmux and Tmuxinator  ~ Rise of the Machines

this is too complex. can’t we automate it?

Page 14: Tmux and Tmuxinator  ~ Rise of the Machines

tmuxinatorhttps://github.com/tmuxinator/tmuxinator

Page 15: Tmux and Tmuxinator  ~ Rise of the Machines

install and create a project

• install the gem:> gem install tmuxinatorfollow README for shell configuration.

• create a new project:> tmuxinator open catproof project conf ~/.tmuxinator/catproof.yml

Page 16: Tmux and Tmuxinator  ~ Rise of the Machines

yml session description

Page 17: Tmux and Tmuxinator  ~ Rise of the Machines

launch a tmuxinator session

• launch:> tmuxinator catproof

Page 18: Tmux and Tmuxinator  ~ Rise of the Machines
Page 19: Tmux and Tmuxinator  ~ Rise of the Machines
Page 20: Tmux and Tmuxinator  ~ Rise of the Machines
Page 21: Tmux and Tmuxinator  ~ Rise of the Machines

pane management

• move between panes:>> C-b 1>> C-b 2

• close a pane by typing `exit` in that pane

Page 22: Tmux and Tmuxinator  ~ Rise of the Machines

why is this important?

• create project specific terminal multiplexing experiences

• save states or share sessions on development servers

• pair with others

Page 23: Tmux and Tmuxinator  ~ Rise of the Machines

– Terminator

“I am a friend of Sarah Connor. I was told she was here. Could I see her please?”