Changed cygwin home location, now the terminal can't find my .minttyrc config file

5,611

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.

Options:
  -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
Share:
5,611

Related videos on Youtube

Shaun
Author by

Shaun

I develop web applications in a variety of languages.

Updated on September 18, 2022

Comments

  • Shaun
    Shaun over 1 year

    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?

    • Admin
      Admin almost 9 years
      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.
    • Admin
      Admin almost 9 years
      @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.
    • Admin
      Admin almost 9 years
      How are you starting mintty?
    • Admin
      Admin almost 9 years
      Try adding -c ~/.minttyrc to your mintty startup shortcut ie C:\cygwin\bin\mintty.exe -c ~/.minttyrc -i /Cygwin-Terminal.ico -
    • Admin
      Admin almost 9 years
      -c FILE is Load specified config file
    • Admin
      Admin almost 9 years
      I'll write it up as an answer then ;)
  • Shaun
    Shaun almost 9 years
    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.