Forked from Nyoho/reload_dot_zshrc_in_all_windows.sh
Created
September 25, 2013 11:02
-
-
Save furu/6698095 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for window in `tmux list-windows -F '#I'`; do | |
tmux select-window -t $window | |
tmux send-keys "source ~/.zshrc" C-m | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
メモ
やっていることとしては、
tmux list-windows
で現在のセッションのウィンドウの番号を取得し、select-window
に取得したウィンドウの番号を渡してウィンドウを選択して、send-keys
で選択したウィンドウに対してsource ~/.zshrc
してる。C-m
は改行ではないけど改行になるって誰かがいってた。このスクリプトだと現在のセッションだけしか適用されなくて、全セッションに対して zshrc の変更を適用させるにはもうちょっとどうにかしないといけない。
tmux list-windows
tmux select-window
tmux send-keys