I had to change the HOME location for Cygwin by setting it to pick up the directory I set in /etc/passwd (following the solution from here). It seems to not be a problem for the majority of my configuration files. .bashrc and .vimrc are read as expected.

But it isn't picking up the configuration for my .minttyrc file. It loads up with the default colors. If I try to add a new setting through Windows, by right clicking on the title bar and selecting Options, it gives me an error:

Could not save options to '[old home directory]':
No such file or directory.

If I rebuild the old home directory and put the .minttyrc file there, it works fine. Is there some place I need to update the location for the .minttyrc separately?

  • You shouldn't have to set HOME at all. Cygwin does all the correct magic. Do you have HOME set in the Windows environment? – DavidPostill Jul 17 '15 at 20:35
  • I don't think the solution in your link will work with recent cygwin versions. The cygwin startup code got completely rewritten. Now for example /etc/password is no longer required. See I am unable to find the etc/passwd file in cygwin and cygwin.com/cygwin-ug-net/ntsec.html for more info about how to correctly change your home directory. – DavidPostill Jul 17 '15 at 20:43
  • @DavidPostill At work, my PC has the HOME environment variable set to a folder in a network drive. When I installed Cygwin, it created a duplicate of this folder on my Desktop and wanted to use that as the HOME folder. I changed it be the home subdirectory of my Cygwin install. I set up the db_home line in /etc/nsswitch.conf as you suggested, and the other configuration files are mentioned are working properly. But it still isn't looking in the right place for .minttyrc. – Shaun Jul 17 '15 at 21:02
  • How are you starting mintty? – DavidPostill Jul 17 '15 at 21:19
  • Try adding -c ~/.minttyrc to your mintty startup shortcut ie C:\cygwin\bin\mintty.exe -c ~/.minttyrc -i /Cygwin-Terminal.ico - – DavidPostill Jul 17 '15 at 21:22

The terminal can't find my .minttyrc config file

You can use the -c file option to specify the location of the mintty configuration file.

The easiest way to do this is to change your mintty shortcut to

C:\cygwin\bin\mintty.exe -c ~/.minttyrc -i /Cygwin-Terminal.ico -

Modify as appropriate for your Cygwin setup.

Further reading

$ mintty --help
Usage: mintty [OPTION]... [ PROGRAM [ARG]... | - ]

Start a new terminal session running the specified program or the user's shell.
If a dash is given instead of a program, invoke the shell as a login shell.

  -c, --config FILE     Load specified config file
  -e, --exec            Treat remaining arguments as the command to execute
  -h, --hold never|start|error|always  Keep window open after command finishes
  -i, --icon FILE[,IX]  Load window icon from file, optionally with index
  -l, --log FILE|-      Log output to file or stdout
  -o, --option OPT=VAL  Override config file option with given value
  -p, --position X,Y    Open window at specified coordinates
  -s, --size COLS,ROWS  Set screen size in characters
  -t, --title TITLE     Set window title (default: the invoked command)
  -u, --utmp            Create a utmp entry
  -w, --window normal|min|max|full|hide  Set initial window state
      --class CLASS     Set window class name (default: mintty)
  -H, --help            Display help and exit
  -V, --version         Print version information and exit
  • 1
    Didn't work on my work environment because of the "HOME" situation, but I tested it out at home by putting the minttyrc configuration somewhere else and updating the path specified in the shortcut. It worked as expected. – Shaun Jul 20 '15 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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