diff --git a/scripts/tmuxs/new.sh b/scripts/tmuxs/new.sh index 161a127..deef6c8 100755 --- a/scripts/tmuxs/new.sh +++ b/scripts/tmuxs/new.sh @@ -24,5 +24,9 @@ if ! tmux has-session -t=$selected_name 2> /dev/null; then tmux new-session -ds $selected_name -c $selected fi -tmux switch-client -t $selected_name +if [[ -z $TMUX ]]; then + tmux attach -t $selected_name +else : + tmux switch-client -t $selected_name +fi