I use gnome-terminal with zsh. I recently had an issue with keeping the current working directory when opening a new tab (CTRL+SHIFT+T) since it used to reset itself to $HOME
everytime. I solved it by adding:
. /etc/profile.d/vte.sh
to the .zshrc
file.
Now, since I use virtualenv (and virtualenvwrapper) I would like to avoid having to do workon virtualenv_name
each time I open a new tab.
The obvious solution is to put that command in the .zshrc
, however I don't want to always enter the virtualenv. I want to do it only when I open a new tab and I am already inside a virtualenv.
Now, since a virtualenv is just a modification to PATH
, PS1
, and stuff like that, I guess I can do this in some way. Any ideas?