I have some .bash_profile
settings that restore my last working directory every time I log in to my shell. However, I also use a program that opens a terminal window in the current directory open in Finder, and it does this by sending an event to Terminal using SBApplication.
Is there a way I can detect which way the Terminal was opened in my .bash_profile
? Right now the bash settings override the cd to app.
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin"
export PATH
# My settings
trap 'printf %s "$PWD" > ~/.storepwd' EXIT
cd "$(<~/.storepwd)"
.bash_profile
that are relevant to this question.