How can I change my Cygwin home folder after installation?

前端 未结 7 1311
太阳男子
太阳男子 2020-11-30 16:43

I just installed Cygwin, and it looks like the home directory in the bash prompt is on my Z: drive. That\'s not where I want it.

How can I change this?

7条回答
  •  [愿得一人]
    2020-11-30 17:28

    I did something quite simple. I did not want to change the windows 7 environment variable. So I directly edited the Cygwin.bat file.

    @echo off
    SETLOCAL
    set HOME=C:\path\to\home
    C:
    chdir C:\apps\cygwin\bin
    bash --login -i
    ENDLOCAL
    

    This just starts the local shell with this home directory; that is what I wanted. I am not going to remotely access this, so this worked for me.

提交回复
热议问题