tags:

views:

413

answers:

3
+1  A: 

Did you enter the shell into /etc/shells. It seems that Mac OS manages the valid shells in there. I can't tell exactly because I'm not on Mac

Norbert Hartl
+3  A: 

As Norbert says, I think the answer is in /etc/shells. Mine has this:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

Add /opt/local/bin/zsh to that list, and you should be fine. You should then be able to change the shell (individually for each user) using chsh.

Telemachus
I find out that Mac has by default Zsh 4.3.4. The one installed by MacPorts is the version 4.2.7. - - My initial problem was to have tab completions for all programs. Note that you can have tab completions without using MacPorts' Zsh by putting the following to your .zshrc: autoload -U compinstall. It finally solved my problem.
Masi
+1  A: 

I know this question was marked answered, but

/opt/local/var/macports/software/zsh/4.2.7_0+mp_completion

is not even an executable file in macports. That's why you got the error. Shells must be executable.

You wanted to set your shell to /opt/local/bin/zsh .

This worked for me both in Leopard and in snow leopard. OSX does not actually use /etc for configuration management, it uses NetInfo ( Leopard ) and now it uses Directory Services ( Snow Leopard) . You wanted to set that in by right clicking on your user in System Preferences > Accounts,( S.L.) or by using Netinfo Manager (Leopard)

EDIT:

Snow Leopard: sudo dscl . -create /Users/chiggsy UserShell /opt/local/bin/zsh

(create creates or updates )

EDIT: Please picture me covered in foul, stinking shame. I'm using iTerm, and changing the shell in my account worked flawlessly. In Terminal, I got the same result as the OP, and fixed it by editing /etc/shells. Now, it seems to me that I should not be able to bypass the /etc/shells restriction by simply using a 3rd party terminal, but it seems that is the case.

chiggsy
iTerm didn't change your login shell *or* bypass /etc/shells in any way. It just set your preference for which shell iTerm runs.
graywh