Изменено домашнее местоположение cygwin, теперь терминал не может найти мой конфигурационный файл .minttyrc

4666
Shaun

Мне пришлось изменить HOMEместоположение Cygwin, настроив его на выбор каталога, который я установил /etc/passwd(следуя приведенному ниже решению ). Кажется, это не проблема для большинства моих файлов конфигурации. .bashrcи .vimrcчитаются, как и ожидалось.

Но он не подбирает конфигурацию для моего .minttyrcфайла. Он загружается с цветами по умолчанию. Если я пытаюсь добавить новый параметр через Windows, щелкнув правой кнопкой мыши строку заголовка и выбрав «Параметры», выдается сообщение об ошибке:

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

Если я восстановлю старый домашний каталог и .minttyrcпоместу туда файл, он будет работать нормально. Есть ли место, где мне нужно обновить местоположение .minttyrcотдельно?

1
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 8 лет назад 0
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](http://stackoverflow.com/q/28573763) and https://cygwin.com/cygwin-ug-net/ntsec.html for more info about how to correctly change your home directory. DavidPostill 8 лет назад 0
@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 8 лет назад 0
How are you starting mintty? DavidPostill 8 лет назад 0
Try adding `-c ~/.minttyrc` to your mintty startup shortcut ie `C:\cygwin\bin\mintty.exe -c ~/.minttyrc -i /Cygwin-Terminal.ico -` DavidPostill 8 лет назад 0
`-c FILE` is Load specified config file DavidPostill 8 лет назад 0
That sounds promising. It's been working fine on my home machine, so I'll try it out when I get back to work on Monday. Shaun 8 лет назад 0
I'll write it up as an answer then ;) DavidPostill 8 лет назад 0
@DavidPostill, я опубликовал [связанный вопрос] (http://superuser.com/questions/942908/changing-the-home-for-cygwin), потому что я думаю, что проблема может быть, как вы предложили в комментариях, что мой дом каталог установлен неправильно. Домашний каталог, казалось, был установлен правильно, но после перезапуска он снова испортился. Я попытался установить новую установку Cygwin, чтобы удалить все настройки, которые я выполнил, установив home из `/ etc / passwd`, и он больше не мог найти правильный домашний каталог, даже если он указан в` / etc / nsswitch.conf` файл. Shaun 8 лет назад 0

1 ответ на вопрос

2
DavidPostill

Терминал не может найти мой файл конфигурации .minttyrc

Вы можете использовать -c file опцию, чтобы указать расположение файла конфигурации mintty.

Самый простой способ сделать это - поменять ярлык на mintty на

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

Измените в соответствии с вашими настройками Cygwin.


дальнейшее чтение

$ 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 
Я не работал в моей рабочей среде из-за ситуации «HOME», но я протестировал ее дома, поместив конфигурацию minttyrc в другое место и обновив путь, указанный в ярлыке. Сработало как положено. Shaun 8 лет назад 1