3

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

5
  • 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.
    – nohillside
    Commented Mar 7, 2013 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
    Commented Mar 7, 2013 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
    Commented Mar 7, 2013 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
    Commented Mar 7, 2013 at 16:48
  • @romeovs - consider adding an answer to your question below to help those who find this question in the future.
    – zwerdlds
    Commented Mar 7, 2013 at 17:22

1 Answer 1

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .