diff --git a/.bin/tmux-projectinator b/.bin/tmux-projectinator index f6f7dfb..33b32e4 100755 --- a/.bin/tmux-projectinator +++ b/.bin/tmux-projectinator @@ -7,12 +7,12 @@ bind '"\e": "\C-W\c-d"' move_pane () { tmux has-session -t $SESSION_NAME 2>/dev/null if [ $? != 0 ]; then - tmux new-session -s $SESSION_NAME -d -n $PROJECT #2>/dev/null + tmux new-session -s $SESSION_NAME -d -n $PROJECT -c $1 fi tmux has-session -t $SESSION_NAME:$PROJECT 2>/dev/null if [ $? != 0 ]; then - tmux new-window -t $SESSION_NAME: -n $PROJECT -d -c $SELECTED + tmux new-window -t $SESSION_NAME: -n $PROJECT -d -c $1 fi tmux switch-client -t $SESSION_NAME:$PROJECT @@ -33,15 +33,12 @@ SESSION_NAME=$([ -z "${CUSTOM_SESSIONS[$ROOT]}" ] && echo "$ROOT" || echo "${CUS while getopts ":l" option; do case $option in l) - tmux send-keys 'cd $SELECTED' Enter + tmux send-keys "cd $SELECTED" Enter # Close tmux popup if any tmux display-popup -C ;; - *) - move_pane - ;; esac done - +if [ $OPTIND -eq 1 ]; then move_pane "$SELECTED"; fi