Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Xterm title changing prompt problem: HELP!



Andrew Gallagher <andrew.gallagher@xxxxxxxxxxxxx> writes:

> PROMPT='%? //%n@%B%m%b%//
> %l%1v%!> '
> RPROMPT='(%T, %w)'
> function precmd {
>  echo -n "^[]0;//$USER@$HOSTNAME$PWD/ ($UNAME)^G"
>  }

Or you can use print, of course.  Here's mine:

# Set prompts
PROMPT=$(echo -n '%{\e[39;49m%}%m%#%(1v:+:)%{\e[39;49m%} ')
RPROMPT=$(echo -n ' %{\e[32;40m%}%~%{\e[39;49m%}')

precmd() {
    print -Pn '\e]0;%n@%m:%~\a'
  if jobs % >& /dev/null; then
    psvar=("")
  else
    psvar=()
  fi
}



Messages sorted by: Reverse Date, Date, Thread, Author