可以直接切換到Tmux 不同session
加在.bashrc內
tmux_goto_branch ()
{
P="$1"
if [ "$P" == ""]
then
echo "$0: must enter branch name..."
exit
fi
tmux has -t $PROJ
if [[ "$?" == "0" ]];
then
echo "$0: Session exist, switch to it";
tmux attach -t $PROJ
else
echo "$0: Session not exist, create a new one"
tmux new -s $PROJ -n $PROJ
fi
}
用法: tmux_goto_branch BRANCH_TEST
沒有留言:
張貼留言