Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Recently my mac has started asking me for a password after I use cd in Terminal.app (haven't tested other term apps).

strangely though, if I press ctrl-C when the passowrd is asked, the question goes away and I'm left in the dir I was cd-ing to (as one would expect).

how can I find out what this password is needed for or how to stop this? I'm using zsh

EDIT:

The terminal asks for a password at random moments, for random directories. Not a clue as to any pattern. The output is basically:

cd ~/Downloads
Password:

I think this started happening after I installed JewelryBox.app

share|improve this question
2  
A few more details would probably be helpful here. Does it happen with all cd commands or only for specific directories? If the second, any idea on what these have in common and/or what puts them apart from the others? Also posting a screenshot (or a text copy) of the message (and the cd part) would give some hints. –  patrix Mar 7 '13 at 13:41
    
Can you write some output in Terminal like whence cd, which cd, echo $SHELL. It seems this command is different than builtin –  Eir Nym Mar 7 '13 at 14:44
    
echo $SHELL gives /bin/zsh and which says cd: shell built-in command. whence cd just says cd. I remmeber there is a zsh thing you can enable as to see all the commands executed when you do something, xset or something like that but I cannot remember exactly what. –  romeovs Mar 7 '13 at 16:45
2  
set -x that was it. cd-ing to a dir outputs a lot stuff, including a lot of references to rvm, rubies, ... so I think the culprit must be JewelryBox or any of it's installed rvms. –  romeovs Mar 7 '13 at 16:48
    
@romeovs - consider adding an answer to your question below to help those who find this question in the future. –  zwerdlds Mar 7 '13 at 17:22
add comment

1 Answer

You can run set -x to make zsh print a trace of every command it executes. When a command is executed by a function, the function name is printed. Run set +x to stop printing traces.

If something is happening when you use the cd command, it can be because this is an alias or function. Check with type cd.

Zsh has a built-in feature to hook onto the cd command, so wrappers around the built-in command are rarely used. If the function chpwd exists, zsh runs it immediately after changing the directory. Check what the chpwd function does with which chpwd.

There are also hooks that run before and after every command: the preexec and precmd functions. Furthermore, all these hooks have an array version, which is an array of function names. Check these arrays with echo $chpwd_functions, and if there is a function, look at its code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.