Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to start an interactive zsh (on cygwin) with project specific set-up:

  1. source /etc/profile
  2. source ~/.profile
  3. source $PROJECT_HOME/Setup.zsh
  4. become interactive

I got as far a step 3 but then the shell just terminates.

I have done this kind of thing before but I forgot how I did it. I tried to google for it but could not find anything. Probalby a case of having the wrong search terms.

Adding $PROJECT_HOME/Setup.zsh to ~/.profile is of course no solution as the idea is to have multiple start-up icons on the windows desktop to start shells for one of many project.

share|improve this question
up vote 2 down vote accepted

Make your shortcuts look like:

env PROJECT_HOME=~/projects/this zsh

env PROJECT_HOME=~/projects/that zsh

Sourcing $PROJECT_HOME/Setup.zsh will work fine now.

share|improve this answer
Actually more like env PROJECT_HOME=~/projects/that zsh --login -i $PROJECT_HOME/Setup.zsh — After which the shell just ends instead of becoming interactive. I think there is an option missing but I can't find out which one. — The idea is to set it up a start icon so I don't need to type the source command manually – Martin Sep 30 '11 at 9:06
I said sourcing $PROJECT_HOME/Setup.zsh -- as in, from your ~/.zshrc -- not running from the command line. – grawity Sep 30 '11 at 9:27
I see what you mean: c:\cygwin\bin\env.exe PROJECT_HOME=/Work/projects/this /bin/zsh. Yes that could work with some fine tuning. I'll give it a try. Thanks. – Martin Sep 30 '11 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .