|
@@ -86,7 +86,11 @@ do
|
|
|
TAB=${!OPTIND}
|
|
|
OPTIND1=$(( OPTIND + 1 ))
|
|
|
COMMAND=${!OPTIND1}
|
|
|
- tmux new -s "${OPTARG}" -n "${TAB}" -d "${COMMAND}"
|
|
|
+ if tmux has-session -t "${OPTARG}" ; then
|
|
|
+ TMUX='' tmux attach-session -t "${OPTARG}" \; new-window -d -n "${TAB}" "${COMMAND}" \; detach-client
|
|
|
+ else
|
|
|
+ TMUX='' tmux new -s "${OPTARG}" -n "${TAB}" -d "${COMMAND}"
|
|
|
+ fi
|
|
|
exit
|
|
|
;;
|
|
|
h)
|