draemonash2のメモ書き
tmuxtmux new -s <session_name>Ctrl-b d # Detachtmux a # Attachtmux a -t <session_name>tmux list-sessionsCtrl-b stmux kill-sessiontmux kill-servertmux kill-session -t <session_name>exit【セッション削除】 Ctrl-d
【接続クライアント確認】 tmux list-client # 接続中のクライアント(=ターミナル)一覧を表示する
Ctrl-b c # CreateCtrl-b n # NextCtrl-b p # PrevCtrl-b l # LastCtrl-b 数字Ctrl-b 'Ctrl-b w # WindowCtrl-b ,Ctrl-b .exitCtrl-d【ウィンドウ削除 (確認付き)】 Ctrl-b &
Ctrl-b "Ctrl-b %Ctrl-b 矢印Ctrl-b oCtrl-b ;Ctrl-b qCtrl-b { / Ctrl-b }Ctrl-b zCtrl-b SPACECtrl-b tCtrl-b !exitCtrl-d【ペイン削除(確認付き)】 Ctrl-b x
Ctrl-b [qCtrl-b ]h/j/k/lCtrl-u / Ctrl-dCtrl-b / Ctrl-fSPACEENTER【コピーモード 矩形モード切替え】 v
Ctrl-b ?【コマンド入力モード】 Ctrl-b :
tmux show-options -stmux show-options -gtmux show-optionstmux show-options -wgtmux show-window-options -g【オプション表示(現在ウィンドウ)】 tmux show-window-options
tmux set-window-option synchronize-panes ontmux set-window-option synchronize-panes offxpanes -e "top" "vmstat 1" "watch -n 1 free".tmux.conf上で、以下のように条件分岐させて同じキーで別の処理を割り当てる
(uname | grep -q Linux && test "${MYTERM_PRG}" == "TeraTerm"); echo $?
(uname | grep -q Linux && test "${MYTERM_PRG}" == ""); echo $?
(uname | grep -q Darwin && test "${MYTERM_PRG}" == "TeraTerm"); echo $?
(uname | grep -q Darwin && test "${MYTERM_PRG}" == ""); echo $?
./.local/share/tmux/resurrect/last $ vncserver -list
TurboVNC server sessions:
X DISPLAY # PROCESS ID
:1 12345
:3 23456
$ ps -ef | grep [X]vnc
endo 1780582 2441732 0 May28 pts/126 00:00:05 /opt/TurboVNC/bin/Xvnc :1 -desktop TurboVNC: robocip-ubuntu:1 (endo) -auth /home/endo/.Xauthority -geometry 1920x1080 -depth 24 -rfbauth /home/endo/.vnc/passwd -x509cert /home/endo/.vnc/x509_cert.pem -x509key /home/endo/.vnc/x509_private.pem -rfbport 5901 -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1 -deferupdate 1 -dridir /usr/lib/x86_64-linux-gnu/dri -registrydir /usr/lib/xorg
ちなみに、何らかの理由でディスプレイ番号が使われている場合、vncserver起動時に以下のようなメッセージが表示される
WARNING: robocip-ubuntu:2 is taken because of /tmp/.X11-unix/X2
Remove this file if there is no X server robocip-ubuntu:2
~が送信されている。F2は2~、F3は3~。vimの~は大文字小文字入れ替え。ctrl+bをctrl+,に置き換えているためBSpaceへ割り当てる
bind Bspace select-pane -L<bs>へ割り当てる
noremap <bs> 10zh10hDISPLAYの値がずれていることで、正しいXサーバにクリップ操作が届かないため。:1になるように起動するDISPLAYを設定(例: export DISPLAY=:3)しても解消しない。