Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TMUX rocks!

Kent Chen
January 16, 2014

TMUX rocks!

TMUX Rocks!
tmux vs. GNU screen
Trick and tips sharing

Kent Chen

January 16, 2014
Tweet

More Decks by Kent Chen

Other Decks in Technology

Transcript

  1. Kent Chen (chenkaie) [email protected] http://chenkaie.blogspot.com @chenkaie on GitHub @chenkaie on

    SlideShare @chenkaie on LinkedIn @chenkaie on Twitter @+KentChenAtGoogle on Google+
  2. .

  3. ..

  4. ...

  5. Screenshot Pane 1 Pane 2 Pane 3 Window Left status

    bar Right status bar Session Name Session
  6. $ tmux info Window 1 … Window 2 Window N

    Pane Pane Pane Pane …… Client 1 Client 2 Client N Session
  7. Window 1 … Window 2 Window N Pane Pane Pane

    Pane Client Session 2 $ tmux choose-session Window 1 Pane Session 1 Window 1 Pane Session 3
  8. No transfer effort from Screen 無痛轉換 i.e. 靈的轉移(驚) My modification:

    Ref: http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/examples/screen-keys.conf Soul Transfer by: $ alias screen=tmux
  9. Vertical splitting w/o patching You can patch GNU Screen to

    do it It’s pretty useful under 16:9 widescreen
  10. Multiple root-privileged system administrators can share the same session to

    manage the server. remote SSH w/o leaking your “password” Remote debugging Pair Programming Shared Sessions
  11. Powerline support • Personal bias … XD • UTF-8 status

    line support https://github.com/erikw/tmux-powerline
  12. Scrollback issue * How can I make tmux use my

    terminal's scrollback buffer? ! Normally, tmux enables the terminal's "alternate screen". Most terminals (such as xterm) do not save scrollback for the alternate screen. You might prefer tmux to use the normal screen, so it uses your terminal's scrollback buffer. This way, you can access the scrollback buffer as usual, for example using the mouse wheel - although there is no guarantee output inside tmux will always (or ever) be added to the scrollback. ! You can make tmux use the normal screen by telling it that your terminal does not have an alternate screen. Put the following in ~/.tmux.conf: ! set -g terminal-overrides 'xterm*:smcup@:rmcup@' Ref: tmux FAQ http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ
  13. #  Add  in  .tmux.conf   ! #  Lightning  fast  pane

     movement  w/o  prefix  key  by  <Alt-­‐`>   bind  -­‐n  M-­‐`  select-­‐pane  -­‐t:.+   ! #  Lightning  fast  pane  resize  w/o  mouse  mode  by  <Alt-­‐ArrowKey>   bind  -­‐n  M-­‐up        resize-­‐pane  -­‐U  1   bind  -­‐n  M-­‐down    resize-­‐pane  -­‐D  1   bind  -­‐n  M-­‐left    resize-­‐pane  -­‐L  1   bind  -­‐n  M-­‐right  resize-­‐pane  -­‐R  1   Lightening fast key binding “-n”
  14. #  Add  in  .tmux.conf   ! #  Lightning  fast  entering

     copy-­‐mode  by  <Alt-­‐c>   #  Extremely  useful  when  split-­‐pane  are  heavily  used.   bind  -­‐n  M-­‐c  copy-­‐mode   bind  -­‐n  M-­‐PPage  copy-­‐mode  -­‐u   bind  -­‐n  S-­‐PPage  copy-­‐mode  -­‐u   ! #  Lightning  fast  window  select  by  <Alt-­‐H>  /  <Alt-­‐L>   bind  -­‐n  M-­‐H  prev   bind  -­‐n  M-­‐L  next   Lightening fast key binding (cont.) Entering copy-mode Search keyword in scrollback buffer
  15. Reference Tmux @ Arch Linux wiki https://wiki.archlinux.org/index.php/Tmux Screen vs. tmux

    Faceoff http://jon.endpoint.com/utosc-2012/screen-vs-tmux-faceoff.html Fixing Vim's Background Color Erase for 256-color tmux http://sunaku.github.io/vim-256color-bce.html How to Copy and Paste with tmux on Mac OS X http://robots.thoughtbot.com/how-to-copy-and-paste-with- tmux-on-mac-os-x
  16. Reference cont. wemux: Multi-User Tmux Made Easy https://github.com/zolrath/wemux tmux-powerline https://github.com/erikw/tmux-powerline

    tmux FAQ http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ My .tmux.conf https://github.com/chenkaie/DotFiles/blob/master/.tmux.conf