active=$(tmux list-panes | grep -oE '\d+\s\(active\)')
index=${active:0:1}
__pwd=$(tmux show-environment | grep -e "^TMUXPWD_$index=" | sed 's/.*=//')
tmux $1 $2 -c "$__pwd"

index=$(tmux list-panes | grep -oE '\d+\s\(active\)' | awk '{ print $1; }')
__pwd=$(tmux show-environment | grep -e "^TMUXPWD_$index=" | sed 's/.*=//')
echo "$active | $index | $__pwd"
if [[ -z $__pwd ]];then
    __pwd=$HOME
fi
tmux $1 $2 -c "$__pwd"

Fix tmux multiple pane issues
Fix tmux multiple pane issues
