Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently upgraded my system to snow leopard and now my prompt doesn't work properly. I have this line in my .zshrc file:

PROMPT='%{$fg_no_bold[cyan]%}%n@%{$fg_no_bold[red]%}%m%{$fg_no_bold[green]%}$(git_branch)%{$reset_color%}: '

(where "git_branch" is a function that give me information about the current git branch I'm working on). The problem is that the colors and "git_branch" function aren't being evaluated, they are taken literally, so my prompt is:

%{$fg_no_bold[cyan]%}username@%{$fg_no_bold[red]%}machinename%{$fg_no_bold[green]%}$(git_branch)%{$reset_color%}:

The colors are nice, but the part I'd really like to get working is the git branch info. I've been googling, but haven't found anything yet. I'm a bit of a noob when it comes to zsh, so links to helpful resources would also be appreciated.

zsh --version
zsh 4.3.9 (i386-apple-darwin10.0)
share|improve this question
    
Did you reinstall git? Is git in your when the prompt is created path? The git command is actually git-branch, not under-socre. –  Mark Thalman Jun 30 '10 at 18:06
    
I wrote my own function to give me information about my git branch that I named "git_branch", e.g.: git_branch() { –  phaedryx Jun 30 '10 at 22:26
add comment

1 Answer

You probably have PROMPT_SUBST turned off. To turn it on:

setopt promptsubst

You can add that to your ~/.zhsrc file. You may need to remove or comment out a line similar to unsetopt promptsubst or setopt nopromptsubst (the option names are not case sensitive and underscores are optional and ignored).

See the "Prompting" section in man zshoptions and the "EXPANSION OF PROMPT SEQUENCES" section in man zshmisc for more information.

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.