端æ«ã®ä¸ã§ä»®æ³ç«¯æ«ã管çããtmux(GNU screenã®ä»£æ¿)ã«ã¤ãã¦(ãã¤ã³åå²ã¨ãã®ç®¡ç)
æ¬è¨äºã¯ã端末の中で仮想端末を管理する tmux(GNU screenの代替)について(コピペとバッファに関する操作・バッファ数上限と後方スクロール行数の変更)ãã«ç¶ãå
容ã¨ãªãã
GNU screenã«ãã¦ã£ã³ãã¦ãåå²ããæ©è½ãããããtmuxã®åå²æ©è½ã¯ä¸ä¸/å·¦å³ã®ã©ã¡ãã«ãåå²ã§ããä»ãåãæ¿ãã«ãã¦ã¹ã使ããããã«è¨å®ã§ãããªã©ãæ©è½ãå¼·åããã¦ããããã®åå²ãããããããã®é åã¯ãã¤ã³ã¨å¼ã°ããã
ã¦ã£ã³ãã¦ã®ãã¤ã³åå²ã¯X Window Systemä¸ã®ç«¯æ«ã¨ãã¥ã¬ã¼ã¿ãç¨ãã¦ããã°ããã»ã©å¿
è¦æ§ã¯ãªãããGUIãªãã§ãªã¢ã¼ãæ¥ç¶ããããã*1å ´åãªã©ã«ã¯éå®ãããããããªãã
ããã§ã¯ããã¤ã³åå²ã¨ãã®ç®¡çãè¡ãæä½ãæ±ãã
注æ:æ¬è¨äºå
ã§è¨è¿°ãã¦ããæä½ã¯æ¢å®ã®å²ãå½ã¦ã§ãè¨å®ãã¡ã¤ã«ã«ããå¤æ´ãããã¨ãã§ããã
- åå²
- ã¬ã¤ã¢ã¦ãã®åçå¤æ´
- ãã¤ã³ã®åé¤
- ãã¤ã³ãµã¤ãºã®å¤æ´
- ã¢ã¯ãã£ããªãã¤ã³ã®åãæ¿ã
åå²
Prefix-"(å é¨ã³ãã³ãsplit-window)ã§ç¾å¨ã¢ã¯ãã£ããªã¦ã£ã³ãã¦ãä¸ä¸ã«ãPrefix-%(å é¨ã³ãã³ãsplit-window -h)ã§ã¯å·¦å³ã«åå²ãããåå²ããããã¤ã³ãæ´ã«åå²ãããã¨ãã§ããã
ã¬ã¤ã¢ã¦ãã®åçå¤æ´
ãã¤ã³ã®åå²å¾ã«Prefix-SPACE(å é¨ã³ãã³ãnext-layout)ãæ¼ããã¨ã§ãåå²ã®ã¬ã¤ã¢ã¦ããé ã«å¤æ´ã§ããã- even-horizontal: å·¦å³åå²/çéé*2
- even-vertical: ä¸ä¸åå²/çéé
- main-horizontal: å·¦å³åå²/åºããã¤ã³ã¨çããã¤ã³*3
- main-vertical: ä¸ä¸åå²/åºããã¤ã³ã¨çããã¤ã³
ãããã¯é ã«
- Prefix-Meta*4+1(å é¨ã³ãã³ãselect-layout even-horizontal)
- Prefix-Meta+2(å é¨ã³ãã³ãselect-layout even-vertical)
- Prefix-Meta+3(å é¨ã³ãã³ãselect-layout main-horizontal)
- Prefix-Meta+4(å é¨ã³ãã³ãselect-layout main-vertical)
ã§ããããä¸çºåãæ¿ããããã¨ãã§ããã
ãã¤ã³ã®åé¤
Prefix-x(å é¨ã³ãã³ãconfirm-before kill-pane)ã§ç¢ºèª(yãnãæ¼ã)å¾ã«ç¾å¨ã¢ã¯ãã£ããªãã¤ã³ãéãããPrefix-!(å é¨ã³ãã³ãbreak-pane)ã§ç¾å¨ã¢ã¯ãã£ãã§ãªããã¤ã³ãæ°ããã¦ã£ã³ãã¦ã«ç§»ããç¾å¨ã®ã¦ã£ã³ãã¦ãç¾å¨ã¢ã¯ãã£ããªãã¤ã³ã®ã¿ã«ããã
åèã¨ãã¦ãPrefix-&(å é¨ã³ãã³ãconfirm-before kill-window)ã§ã¯ã確èªå¾ã«ã¢ã¯ãã£ããªã¦ã£ã³ãã¦(åå²ããã¦ããå ´åã¯å ¨ãã¤ã³)ãéãããã¨ãã§ããã
ãã¤ã³ãµã¤ãºã®å¤æ´
ä¸ä¸åå²æã«ã¯Prefix-Ctrl+â(å é¨ã³ãã³ãresize-pane -U)/Prefix-Ctrl+â(å é¨ã³ãã³ãresize-pane -D)ãå·¦å³åå²æã«ã¯Prefix-Ctrl+â(å é¨ã³ãã³ãresize-pane -L)/Prefix-Ctrl+â(å é¨ã³ãã³ãresize-pane -R)ã§ãã¤ã³ã®ãµã¤ãº(åºåãç·ã®ä½ç½®)ã1ãã¤èª¿æ´ã§ãããä¸ä¸åå²æã«Prefix-Meta+â(å é¨ã³ãã³ãresize-pane -U 5)/Prefix-Meta+â(å é¨ã³ãã³ãresize-pane -D 5)ãå·¦å³åå²æã«Prefix-Meta+â(å é¨ã³ãã³ãresize-pane -L 5)/Prefix-Meta+â(å é¨ã³ãã³ãresize-pane -R 5)ã§5ãã¤èª¿æ´ã§ããã
ã¢ã¯ãã£ããªãã¤ã³ã®åãæ¿ã
ã¢ã¯ãã£ããªãã¤ã³ã¯Prefix-â(å é¨ã³ãã³ãup-pane)ã¨Prefix-â(å é¨ã³ãã³ãdown-pane)ã§åãæ¿ãã§ãããããã«å ãã以ä¸ã®è¨å®ã«ããããã¤ã³åå²æã«ãã¦ã¹ã¯ãªãã¯ã§ã¢ã¯ãã£ããªãã¤ã³ãåãæ¿ãå¯è½ã«ãªãã
ãã¡ã¤ã«å: ~/.tmux.conf
## ãã¦ã¹ã¯ãªãã¯ã§ãã¤ã³é¸æ
set-option -g mouse-select-pane on
ãã®ã¨ãããã¦ã¹ã®ãã©ãã°ã§ç¯å²é¸æã¯ãã®ã¾ã¾ã§ã¯ã§ããªããªãããShiftãã¼ãæ¼ããªããã®ãã©ãã°ã§é¸æã§ããã
使ç¨ãããã¼ã¸ã§ã³:
- tmux 1.1
*1:tmuxã¨é¢ä¿ã¯ãªããããªã¢ã¼ãå´ããSSHã§ã·ã§ã«ã«å ¥ããã¨ãã§ãããããã«è¨å®ãã¦ããã¨ã»ãã¥ãªãã£ã¬ãã«ã¯ä¸ããããã§ãã·ã§ã«ãå¿ è¦ãªããã°ä½¿ããªãããã«ããã»ãã好ã¾ããã¨ããã¦ãã
*2:ãevenãã¨ããããã«åçã«åå²ãã
*3:åºããmainãã®ãã¤ã³ã¨çãsubã®ãã¤ã³ã«åå²ãã
*4:Altãã¼