Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently switched from bash to zsh, but it annoys me that I can't see what directory I'm in (MacOSX)

how do I get 'pwd' to show up in my prompt?

share|improve this question

migrated from stackoverflow.com Jan 21 '10 at 13:49

This question came from our site for professional and enthusiast programmers.

PROMPT='%d%>:%{\e[0m%}'

share|improve this answer
PROMPT="%~$ "

share|improve this answer

I know It's been a while, but I just put this answer here as it is another approach. You can do it like this too:

#this is your PROMPT
PROMPT='$fg[cyan]%m: $fg[yellow]$(get_pwd) '
#this is the function
function get_pwd() {
    echo "${PWD/$HOME/~}"
}

P.S: I recommend you to use oh-my-zsh

share|improve this answer

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.