1. Create a function in the .zshrc
# ~/.zshrc
activate() { if [ -d ".venv" ]; then source .venv/bin/activate else : # ignore if no .venv fi
}
2. Set iTerm to call this function on a new tap
iTerm2: Preferences -> Profiles -> Command: Login Shell -> Send text at start: “activate”
https://minho42.com/posts/auto-activate-venv-on-iterm/
Discover more from Coursity
Subscribe to get the latest posts sent to your email.