dot/shell-rc: Introduce `$__mdw_user' as an indirection over `$USER'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 May 2020 22:33:09 +0000 (23:33 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 13 May 2020 17:31:10 +0000 (18:31 +0100)
dot/shell-rc

index bec48d4..ee9161d 100644 (file)
@@ -68,6 +68,7 @@ __mdw_hqual=$__mdw_hqual${CROSS_BUILDENV+/$CROSS_BUILDENV}
 __mdw_set_prompt_hacks () { host=$__mdw_host; dir=""; }
 
 : ${USER-${LOGNAME-$(id -un)}}
+__mdw_user=$USER
 
 __mdw_set_prompt_pieces () {
 
@@ -89,7 +90,7 @@ __mdw_set_prompt_pieces () {
     *)
       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
@@ -149,7 +150,7 @@ __mdw_set_prompt () {
 __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"; }