tmux

9383 단어 tmux

tmux basic concept





command



general



attach existing session


tmux attach -t <settion name>

detach current session


prefix + d

reload configuration file again


prefix + :source-file ~/.tmux.conf

List all key bindings


prefix + ?

session



Detach the current session.


prefix + d

Select a new session for the attached client interactively.


prefix + s


Kill last joined session.


tmux kill-session



Create a new window


prefix + c

Change to the previous window


prefix + p

Change to the next window


prefix + n

Choose window from a current session


prefix + w


pane



Split specific pane


  • "bash"is window name
  • "0"is pane name
  • split "0"pane on "bash"window horizontally
  • tmux split-window -t "bash.0" -h
    

    Split the current pane horizontally.


    prefix + "


    Split the current pane vertically.


    prefix + %


    Select the next pane in the current window.


    prefix + o

    Break the current pane out of the window.


    prefix + !

    Move pane from the specifed window.


    join-pane -s :<window name>

    Move pane to the specifed window.


    join-pane -t :<window name>

    Show the time.


    prefix + t


    tmux.conf sample



    tmux.conf
    set -g mode-mouse on
    set -g mouse-resize-pane on
    set -g mouse-select-pane on
    set -g mouse-select-window on
    
    bind -n M-Space next-window
    bind y send-keys 'set-window-option synchronize-panes' Enter
    
    ## unbind default prefix key
    unbind-key C-b
    
    ## make Ctrl+j prefix key
    set-option -g prefix C-j
    bind-key C-j send-prefix
    
    # synchronize shortcut key
    bind e setw synchronize-panes on
    bind E setw synchronize-panes off
    

    tmux tips



    share session with other operator



    t무xぉ은. sh



    Open multiple tmux panes, each logged into a different server
    htps : // 기주 b. 이 m / 타박상 t / sc 리 pts / b ぉ b /까지 r / t는 x ㎉ 긴. sh
    tmuxlogin.sh -w session -t window server1 server2 server3 server4



    cmatrix






    ~/.tmux.conf
    set -g lock-after-time 600
    set -g lock-command "cmatrix -s -b"
    

    tmux installation



    source installation


    # get source file
    wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz
    wget -k --no-check-certificate https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    
    # libevent installation
    tar zxvf libevent-2.0.21-stable.tar.gz
    ./configure --prefix=/home/toripiyo 2>&1 | tee _configure.log
    make 2>&1 | tee _make.log
    make install 2>&1 | tee _make_install.log
    
    # copy behavior settings
    ## Copy from tmux buffer to system buffer (clipboard)
    http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
    Go to iTerm2 > Preferences > “General” tab, and in the “Selection” section, check the box which says “Applications in terminal may access clipboard” if it isn’t checked.
    
    # tmux installation
    DIR="$HOME/lib"
    ./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib" --prefix=/home/toripiyo/tmux-1.8 2>&1 | tee _configure.log
    make 2>&1 | tee _make.log
    make install 2>&1 | tee _make_install.log
    

    copy behavior settings



    Copy from tmux buffer to system buffer (clipboard)



    h tp // w w. 루시아 gr. 이 m / b ぉ g / 2016/06/16 / 에ゔ ぇ ry ぃ ん ー ー ー ー ー ー d ー ー k
    Go to iTerm2 > Preferences > “General” tab, and in the “Selection” section, check the box which says “Applications in terminal may access clipboard”

    tmux trouble shooting



    tmux cannot open atom from console


    [17:38:13 - 15-02-01] /Users/toripiyo/program/rails/housmart/db % atom seeds.rb
    LSOpenURLsWithRole() failed for the application /opt/homebrew-cask/Caskroom/atom/latest/Atom.app with error -10810.
    
  • upgrade reattach-to-user-namespace.
  • [18:59:14 - 15-02-01] /Users/toripiyo % reattach-to-user-namespace -l
    warning: unsupported new OS, trying as if it were 10.6-10.8
    fatal: _vprocmgr_move_subset_to_user failed
    [18:59:20 - 15-02-01] /Users/toripiyo % brew upgrade reattach-to-user-namespace
    ==> Upgrading 1 outdated package, with result:
    reattach-to-user-namespace 2.3
    ==> Upgrading reattach-to-user-namespace
    ==> Downloading https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/archive/v2.3.tar.gz
    ######################################################################## 100.0%
    ==> Patching
    ==> make
    ?  /usr/local/Cellar/reattach-to-user-namespace/2.3: 6 files, 48K, built in 6 seconds
    
  • add following configuration on .tmux.conf
    htp // 베후오 l. 이. jp / b ぉ g / js / u pg 등으로 - 좋게 보아라 - r-r t /
  • # Fix LSOpenURLsWithRole() error on OS X. Requires reattach-to-user-namespace
    # # to be installed.
    set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL"
    

    참조



    tmux cheet sheet
    htps : // 기 st. 기주 b. 코m/게라인 t/7724164
    1분만에 실현할 수 있는 tmux의 Tips x3 (이어서 install to Mac,CentOS,Debian/Ubuntu)
    ぃ tp // 코 m / 뭉구 @ 갓슈 / ms / 107cbd6cd6db2 아 46172
    Sharing remote terminal session between two users with Tmux
    htp : // Rea dys 4. 코 m / 2011 / 01 / 02 / 샤린 g - 레모테 - r 모두 l - 싯시 온 - 베와 ぇ - ぉ - 우세 rs - ぃ th t m x /

    좋은 웹페이지 즐겨찾기