MinGW Bash profile
bash
is probably getting started as a login shell, in which case it doesn't read .bashrc
automatically. Instead, it reads .bash_profile
. From the Bash manual:
So, typically, your `~/.bash_profile' contains the line
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
after (or before) any login-specific initializations.
So in summary, create a .bash_profile
file in your homedir, and add the line quoted above.
If your bash
is actually getting invoked as sh
, then you'll need to use .profile
instead of .bash_profile
(see the "Invoked with name sh" section of the Bash manual link above).
I am running Windows XP and had the same problem. I found HOWTO Create an MSYS Build Environment.
This is the important line:
To help identify the runtime build and the current working directory, the following can be added to the ~/.profile
file.
In MinGW shell, I created .profile
:
cd ~
touch .profile
I used Notepad++ to edit it as a Unix format text file named .profile
and saved it in my home directory, C:\MinGW\msys\1.0\home\Your_Username_Here\.profile
Then I added my alias and saved:
alias n='nano -w'
Then I fired up the MinGW Shell shortcut from my start menu and hurray, it worked! nano with no text wrapping.
I hope this helps you.
For me for MINGW installed with GIT, worked: .bash_profile put in C:\Users\[user_name]
This is also the directory where ~ points to in shell (pwd).
Just like that :)