Difference between revisions of "Tmux"

From Applied Optics Wiki
Jump to: navigation, search
Line 18: Line 18:
 
That's it. If you want be more advanced, these shortcuts will help;
 
That's it. If you want be more advanced, these shortcuts will help;
  
* Split your current terminal vertically <code>ctrl+b</code> <code>"</code>
+
* Split your current terminal vertically <code>ctrl+b</code> then <code>"</code>
* Split your current terminal horzontally <code>ctrl+b <code>%</code>
+
* Split your current terminal horzontally <code>ctrl+b</code> then <code>%</code>
 
* Move between your panes <code>ctrl+b</code> then <code>[arrow key]</code>
 
* Move between your panes <code>ctrl+b</code> then <code>[arrow key]</code>
 
* To resize panes <code>ctrl+b</code> then <code>:</code>, then type <code>resize-pane -[direction] [length]</code> where direction is U,D,L,R (up,down,left,right) and length is in number of lines
 
* To resize panes <code>ctrl+b</code> then <code>:</code>, then type <code>resize-pane -[direction] [length]</code> where direction is U,D,L,R (up,down,left,right) and length is in number of lines

Revision as of 11:25, 3 December 2018

Tmux is an incredibly simple and useful bit of software that lets you;

  • Tile multiple terminals into one screen
  • Allow you to log in to a running session, which you can detach from (keeping an processes going) and log off.

There are a number of online tutorials for the first point, but below are the basics for the second;

  • Install Tmux sudo apt-get install tmux
  • Create a new Tmux session tmux new -s [name of session], choose a name that makes sense and you can remember
  • You will then be entered into a tmux session to start processes/work
  • To leave the session running enter crtl+b then d
  • You can now log off and the Tmux session processes will continue running
  • To get back onto your Tmux session tmux attach-session -t [name of session]
  • If you've forgotten what your session was called, you can list all tmux ls
  • To close the session, enter the session and exit

That's it. If you want be more advanced, these shortcuts will help;

  • Split your current terminal vertically ctrl+b then "
  • Split your current terminal horzontally ctrl+b then %
  • Move between your panes ctrl+b then [arrow key]
  • To resize panes ctrl+b then :, then type resize-pane -[direction] [length] where direction is U,D,L,R (up,down,left,right) and length is in number of lines