Using my .bash_profile, I used to change my iTerm2 profile per machine with the following command:
echo -e "\033]50;SetProfile=ssh\a"
Now, I want to change it depending on my current working directory.
Ideally must work something like this:
- Once I enter /mnt/production or any subfolder inside, iTerm should change to production profile.
- Once I leave that directory, should change to bash profile.
Is there any way of doing that?