__mdw_set_prompt_hacks () { host=$__mdw_host; dir=""; }
: ${USER-${LOGNAME-$(id -un)}}
+__mdw_user=$USER
__mdw_set_prompt_pieces () {
## Choose the right delimiters. Highlight root prompts specially;
## highlight when I'm running as some other user. Highlight when this
## isn't the outermost shell on the terminal.
- local left right user u tty
- user=${USER-${LOGNAME-$(id -un)}}
+ local left right u tty
case $(id -u) in
0)
left=$(echo « | iconv -f UTF-8 -t //translit)
right=$(echo » | iconv -f UTF-8 -t //translit)
;;
*)
- case $user in
+ case $USER in
mdw | mwooding | nemo) u="" left="[" right="]" ;;
- *) u="$user@" left="{" right="}" ;;
+ *) u="$__mdw_user@" left="{" right="}" ;;
esac
tty=$(tty)
case "$__mdw_tty" in
__mdw_xterm_settitle () {
printf >/dev/tty \
"\e]2;%s@%s:%s – %s\e\\" \
- "$USER" "$__mdw_host$__mdw_hqual" "$PWD" \
+ "$__mdw_user" "$__mdw_host$__mdw_hqual" "$PWD" \
"$1"
}
__mdw_xterm_precmd () { __mdw_xterm_settitle "$__mdw_shell"; }