Skip to content

Instantly share code, notes, and snippets.

@yaredc
Created January 2, 2021 16:20
Show Gist options
  • Save yaredc/d9426d2677049e41ee83e3d8fc8f8ce4 to your computer and use it in GitHub Desktop.
Save yaredc/d9426d2677049e41ee83e3d8fc8f8ce4 to your computer and use it in GitHub Desktop.
#!/bin/sh
SESSION_NAME="project-session"
if ! tmux has-session -t $SESSION_NAME 2>/dev/null; then
tmux new-session -d -A -s $SESSION_NAME
tmux split-window -h
tmux send-keys "docker-compose up" C-m
tmux select-pane -t 0
tmux split-window -v
tmux send-keys "docker-compose exec php bash"
fi
tmux attach-session -t $SESSION_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment