Closed GoogleCodeExporter closed 8 years ago
By default, mintty stores its config at $HOME/.minttyrc if HOME is set, or at
/home/<loginname>/.minttyrc otherwise. This works fine on MSYS proper. It won't
create any directories though, hence if $HOME and /home/<loginname> don't
exist, config changes are lost. Using -c is an appropriate workaround.
Original comment by andy.koppe
on 14 Jul 2010 at 1:15
I am also experiencing this issue. I have confirmed that the $HOME environment
variable is properly initialized in the msysgit shell, but I'm not sure what
environment variables mintty receives. If I launch mintty from within the
msysgit shell, the new instance DOES read and write the settings.
Original comment by pareja.m...@gmail.com
on 14 Jul 2010 at 2:49
My guess is that $HOME is not set at the time when mintty is launched, but it
gets set by msysgit. IMHO mintty should fall back to $HOMEDRIVE$HOMEPATH, and
$USERPROFILE in that order if $HOME is not set (which is the common case on
Windows).
I also just learned about the difference between $HOMEDRIVE$HOMEPATH and
$USERPROFILE (which are identical on most systems):
http://markmail.org/message/wbzs4gmtvkbewgxi
Original comment by sschuberth
on 14 Jul 2010 at 2:59
Yes, setting HOME in /etc/profile is too late for mintty, since that only gets
sourced by bash running inside mintty. Falling back to $HOMEDRIVE$HOMEPATH
wouldn't work right for standard MSYS, which sets HOME to /home/$LOGNAME in
/etc/profile. (Btw, Cygwin >=1.5 avoids any such problems by setting HOME at
DLL startup.)
Original comment by andy.koppe
on 14 Jul 2010 at 9:15
I see that msysgit stores some dotfiles into its root directory, so how about
invoking mintty with '-c /.minttyrc'?
Original comment by andy.koppe
on 14 Jul 2010 at 9:22
My current work around has been to explicitly set the HOME environment variable
on Windows.
Original comment by pareja.m...@gmail.com
on 14 Jul 2010 at 10:09
Only the msysGit development environment (the environment to work on msysGit
itself, not *with* msysGit) has dotfiles in its root. The real msysGit
installation has not, and it stores .gitconfig etc.
So I guess the best solution really is to use "-c
%HOMEDRIVE%%HOMEPATH%\.minttyrc".
Original comment by sschuberth
on 14 Jul 2010 at 10:44
I see. Is it really a good idea though to write into the user's Windows home
directory, particularly in the case of portable msysgit?
Original comment by andy.koppe
on 15 Jul 2010 at 3:58
[deleted comment]
I believe these settings should be written into the user's home directory (or a
subdirectory). Newer versions of Windows follow the Linux convention of
separating modifiable configuration files from the program executables.
Portable applications are a special case scenario which should be handled by
writing the configuration file to the same directory as the program executable.
This should probably be defined at install time.
Original comment by pareja.m...@gmail.com
on 15 Jul 2010 at 4:20
Right. I'm happy to find that '-c %HOMEDRIVE%%HOMEPATH%' works fine even in the
target field of a Windows shortcut. Issue resolved without a fix. :)
Original comment by andy.koppe
on 15 Jul 2010 at 4:36
FYI you need to put the `-c "%HOMEDRIVE%%HOMEPATH%\.minttyrc"` switch before
the `-e bash` switch.
Original comment by matthew....@featurespace.co.uk
on 20 Mar 2012 at 4:01
Unfortunatly, it's not enough to set the path to .minttyrc. You also would need
some local settings for openssh, vim, etc... I've just written a short
vbscript, which will set HOME enviromental variable before mintty launch:
Set wshShell = CreateObject( "WScript.Shell" )
Set wshSystemEnv = wshShell.Environment( "USER" )
wshSystemEnv( "HOME" ) = wshShell.ExpandEnvironmentStrings(
"%HOMEDRIVE%%HOMEPATH%" )
wshShell.Run """C:\Program Files (x86)\Git\bin\mintty.exe"" -e ""C:\Program
Files (x86)\Git\bin\bash.exe"" --login -i"
I hope it will help.
Original comment by sunrize...@gmail.com
on 19 Jul 2012 at 3:51
Good point Sunrize. Maybe the issue should be reopened?
Original comment by matt.hic...@gmail.com
on 23 Jul 2012 at 8:28
Since this issue report is the top result when searching "could not save
options to .minttyrc" on Google, and it took me a bit to understand what the
solution is from the comments here. I figured I'd comment with an attempt to
make it more clear.
Right click on you Git Bash link, click properties, and set your Target to the
following:
"C:\Program Files (x86)\Git\bin\mintty.exe" -c %HOMEDRIVE%%HOMEPATH%\.minttyrc
-e /bin/bash --login -i
If you're using a 32bit version of Windows, or a 64bit version of git, the
target may need to be:
"C:\Program Files\Git\bin\mintty.exe" -c %HOMEDRIVE%%HOMEPATH%\.minttyrc -e
/bin/bash --login -i
Original comment by t...@zornco.com
on 10 Apr 2015 at 1:09
Original issue reported on code.google.com by
sschuberth
on 14 Jul 2010 at 9:29