Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have MinGW/MSYS on Windows, and can't figure how to start MSYS shell in folder I'm working in.

For example, in Windows console I'm working in folder c:\temp and if I call MSYS (msys.bat) it opens new console window in some fixed location, representing my home folder.

How to change this msys.bat file, so that MSYS shell opens in current working folder (or changes to it, after start)?

share|improve this question
    
Can you include the contents of that batch file in your question? –  Karan Jun 13 '13 at 23:41
    
Sure: github.com/msysgit/msysgit/blob/master/msys.bat –  zetah Jun 13 '13 at 23:57
1  
Unless I missed something I don't see a path being set anywhere in that batch file. My guess is that rxvt/bash are starting up in their default dirs as per their config files. You might be able to pass your current dir (%cd%) to them somehow, but I'm not sure. –  Karan Jun 14 '13 at 0:08
    
Yep, that's what I'm looking for: when calling bash instruct it to change in current working folder under Windows. Cygwin has similar option –  zetah Jun 14 '13 at 0:21

1 Answer 1

up vote 1 down vote accepted

I'm not sure what version of msysgit you are using, but for me calling msys.bat does not change the current directory. If you see the directory being changed, check the etc/profile file in the msysgit directory for cd commands. As this file gets executed when a login shell is started it might be the cause for you to always land in your home directory.

share|improve this answer
1  
Yes, the last line in that file (...\mingw\msys\1.0\etc\profile on my system) is cd "$HOME". If you comment that out bash will start in the current folder, then it's easy enough to type cd to go to the home folder. –  Brian Burns Jul 8 at 9:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.