0

I'm not able to save the mintty windows options due to a not properly set home folder in company's computer.

I've edited etc/profile, adding:

# Added by myself
# set-up home properly
HOME=/c/Users/myuser
HOMESHARE=/c/Users/myuser
HOMEDRIVE=C:
HOMEPATH=/Users/myuser/

and indeed all the variables are set properly in the bash environment:

$ echo $HOME $HOMEDRIVE$HOMEPATH $HOMESHARE
/c/Users/myuser C:/Users/myuser/ /c/Users/myuser

However, when right click the git-bash window to change options line color, fonts, etc and try to save, it says:

Could not save options to 'X:.minttyrc'. Permission denied.

We do have a company drive called X: and some windows variables are pointing to it. However no variable in the bash environment is point to X: as checked calling printenv in git-bash.

How to I tell mintty which folder to use as home?

I'm using git-bash 2.19.2 for windows. The git-bash is running mintty 2.9.3.

Raf
  • 1,628
  • 3
  • 21
  • 40

1 Answers1

0

As it looks like, some environmental variables in git-bash in windows are defined by the variables available in the windows environment, prior to git reading profile.

To solve that, instead of calling git-bash directly, I've made a batch file setting these variable properly:

set HOMEDRIVE=C:
set HOMEPATH=\Users\username\
\path\to\git-bash.exe %1

That worked fine.


Note 1: To fix the Git Bash Here menu item, edit registry. Search for all entries calling git-bash.exe and replace by the bat file.


None 2: I don't have admin rights to the workstation I use so I can't edit HOMEDRIVE and HOMEPATH in the system.

Raf
  • 1,628
  • 3
  • 21
  • 40