Search code examples
cygwin

How do I get Cygwin xterm to use bash and not sh?


Just updated cygwin to 1.7.28 on Windows 7.

Previously when starting X, the xterm would open with bash. For some reason it is now opening with sh? What configuration changes do I need to make so that bash is the default shell again? Not sure why this change happened.

The shortcut to open the xterm is the same as it was during my initial installation.

 C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe

But it still starts with the default shell set to sh. I don't understand what changed.

My passwd file is the same as it was before.

It appears that everything starts fine with the standard shortcuts, but the X and xterm startups are not sourcing /etc/profile


Solution

  • xterm seems to need the /etc/shells file to be present to work. Add an /etc/shells file with the following contents:

    # /etc/shells: valid login shells
    /bin/csh
    /bin/sh
    /bin/bash
    /bin/tcsh
    /usr/bin/csh
    /usr/bin/sh
    /usr/bin/bash
    /usr/bin/tcsh
    

    Chris