I am using KornShell (ksh) on Solaris and currently my PS1 env var is:
PS1=\"${HOSTNAME}:\\${PWD} \\$ \"
And the prompt displays: hostname:/fu
hostname:/fu
HOST=`hostname` PS1='$(print -n "[${USER}@${HOST%%.*} ";[[ "$HOME" == "$PWD" ]] && print -n "~" ||([[ "${PWD##*/}" == "" ]] && print -n "/" || print -n "${PWD##*/}");print "]$")'