summaryrefslogtreecommitdiffstats
path: root/muxSend
blob: c70be379134835cbab2c3df5ab4746d64d7327dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
if [[ $# < 1 ]];then
    exit
fi

data="[email protected]"

for sess in $(tmux list-sessions | cut -d ":" -f 1);do
    tmux set-buffer   "$data"
    for window in $(tmux list-windows -t $sess | tr -d ' ');do
        if grep -q -E "(zsh|bash)" <<< $window;then
            tmux paste-buffer -t $sess:${window%:*}
            tmux send-keys -t $sess:${window%:*} "Enter"
        fi
    done
done
# vim: set ft=sh