How can I configure zsh to be the default shell under Cygwin?
migrated from stackoverflow.com Oct 28 '11 at 2:58
This question came from our site for professional and enthusiast programmers.
Unless you're using cygwin as a multiuser environment (in which case use
Otherwise, you just change cygwin.bat to run
Of course, if you want to run multiple shells from startup, just create a set of
I felt I should update this to provide info on doing this without
If I read your question right, you're looking for something else than what chere supplies (which, granted, is pretty cool in its own right).
The current version of Cygwin doesn't have an /etc/passwd file, and the system I'm working on has Windows account information in a domain database out of my control. Consequently, chsh is no longer supported.
I also found that bash is not hard-coded into the startxwin script, nor is it hard-coded in any .bat file. Turns out you don't need to fiddle with .bat files at all.
Searching for how to change my shell, I found some advice about mkpasswd
I added it to the mix.
The man-page said:
(I don't know why the spacing is so "off"...)
I then used the following command:
mkpasswd -c | sed -e 'sX/bashX/zshX' | tee -a /etc/passwd
The next time you open a Cygwin Terminal, it will go straight to zsh
And that, I think, is what you asked for.
Just thought I'd add this answer in case it helps anyone who's looking for it. If you use chere (which adds a "Bash prompt here" option to the right-click context menu of any folder), you can set it to zsh ("Zsh Prompt Here") with: