draemonash2のメモ書き
tmux
tmux new -s <session_name>
Ctrl-b d
# Detachtmux a
# Attachtmux a -t <session_name>
tmux list-sessions
Ctrl-b s
tmux kill-session
tmux kill-server
tmux 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 .
exit
Ctrl-d
【ウィンドウ削除 (確認付き)】 Ctrl-b &
Ctrl-b "
Ctrl-b %
Ctrl-b 矢印
Ctrl-b o
Ctrl-b ;
Ctrl-b q
Ctrl-b {
/ Ctrl-b }
Ctrl-b z
Ctrl-b SPACE
Ctrl-b t
Ctrl-b !
exit
Ctrl-d
【ペイン削除(確認付き)】 Ctrl-b x
Ctrl-b [
q
Ctrl-b ]
h
/j
/k
/l
Ctrl-u
/ Ctrl-d
Ctrl-b
/ Ctrl-f
SPACE
ENTER
【コピーモード 矩形モード切替え】 v
Ctrl-b ?
【コマンド入力モード】 Ctrl-b :
tmux show-options -s
tmux show-options -g
tmux show-options
tmux show-options -wg
tmux show-window-options -g
【オプション表示(現在ウィンドウ)】 tmux show-window-options
tmux set-window-option synchronize-panes on
tmux set-window-option synchronize-panes off
xpanes -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> 10zh10h
DISPLAY
の値がずれていることで、正しいXサーバにクリップ操作が届かないため。:1
になるように起動するDISPLAY
を設定(例: export DISPLAY=:3
)しても解消しない。