#!/bin/sh test -z "$1" || test -z "$2" && { >&2 echo "usage: ${0##*/} window path command"; exit 1; } tmux select-window -t "$1" 2>/dev/null || if test -n "$3" then tmux new-window -n "$1" -c "$HOME/$2" "$3" else tmux new-window -n "$1" -c "$HOME/$2" fi