I've got a bash script with a function that opens a number of windows,
killing them first to avoid creating more than one of the same window:
tmux kill-window -t "${TMUX_SESSION}:${name}"
tmux new-window -k -n "$name" -t "${TMUX_SESSION}" "$cmd"
This function gets called with names like "Project
ce to have an exact-match-only flag or something but at the
> moment you can use the window id - something like:
>
> x=$(tmux lsw -F'#{window_id},#{window_name}'|awk -F, '/,Project DB$/
> {print $1}')
> [ -n "$x" ] && tmux killw -t$x
>
>
> O