1 2 3 4 5 6 7
#!/bin/sh if tmux list-windows | grep -q "^$1:"; then tmux select-window -t "$1" else tmux new-window -t "$1" fi