From 85e5c878aa73a9e27dc03ec71ab1a1be4d36fd49 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 8 May 2020 23:33:09 +0100 Subject: [PATCH] dot/shell-rc: Introduce `$__mdw_user' as an indirection over `$USER'. --- dot/shell-rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dot/shell-rc b/dot/shell-rc index bec48d4..ee9161d 100644 --- a/dot/shell-rc +++ b/dot/shell-rc @@ -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 \ "]2;%s@%s:%s – %s\\" \ - "$USER" "$__mdw_host$__mdw_hqual" "$PWD" \ + "$__mdw_user" "$__mdw_host$__mdw_hqual" "$PWD" \ "$1" } __mdw_xterm_precmd () { __mdw_xterm_settitle "$__mdw_shell"; } -- 2.11.0