binarysmacker
binarysmacker

Reputation: 1122

Git's "Bash.exe" vs "Git Bash.vbs"

After some playing around ive noticed that some things dont work inside bash when just running the commands in bash.exe.

The problems are to do with virtualenvwrapper. Not activating the environments correctly.

ERROR: Environment '/e/virtualenvs/test' does not contain an activate script.

And also not listing environments when doing workon. It just shows an empty list.

But if its done in bash by launching it through "Git Bash.vbs", all the commands work fine, and the environments activate etc.

I've tried looking at the vbs file but im not really used to vbs code and not sure what's going on.

So I would like to know what the .vbs does to make things "work" in bash that would otherwise not work. Hopefully its not a virtulenvwrapper specific problem but a general thing that the .vbs file does to make things more compatible?

EDIT: Update

Ok, so after some more testing I have found exactly what is the trigger but I still dont now why its makes it work.

If I launch sh.exe from gits directory I get the original broken behaviour. But running sh.exe --login and virtualenvwrapper works.

So it should be now - What is --login doing to make things "work"

Upvotes: 3

Views: 1883

Answers (1)

kostix
kostix

Reputation: 55443

The --login command-line option passed to bash make it behave as a "login shell"—the one started for the user when it logs in (supplies their user name and the matching password when prompted by the system with that olden classic "Login: " prompt).

While the description above sort-of states an obvios thing, the real difference in behaviour from "normal" calls to the shell is in the startup files it reads. Refer to this section (see the discussions of the --login and -l command-line options there) and then appropriate bit form here.

Then find all the files it reads under the etc directory under your Git installation directory. Namely, what you'll be looking for is etc\profile.

Supposedly that file sets certain things up in the shell affecting its behaviour.

Upvotes: 1

Related Questions