chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
81ba988
)
dot/shell-rc: Introduce `$__mdw_user' as an indirection over `$USER'.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 8 May 2020 22:33:09 +0000
(23:33 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 13 May 2020 17:31:10 +0000
(18:31 +0100)
dot/shell-rc
patch
|
blob
|
blame
|
history
diff --git
a/dot/shell-rc
b/dot/shell-rc
index bec48d4ec78622cf5dd9b3cc6a3876ed384d7633..ee9161daaa65205b82715cbfa0e03c1af98d12dd 100644
(file)
--- 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_set_prompt_hacks () { host=$__mdw_host; dir=""; }
: ${USER-${LOGNAME-$(id -un)}}
+__mdw_user=$USER
__mdw_set_prompt_pieces () {
__mdw_set_prompt_pieces () {
@@
-89,7
+90,7
@@
__mdw_set_prompt_pieces () {
*)
case $USER in
mdw | mwooding | nemo) u="" left="[" right="]" ;;
*)
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
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
\\" \
__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"; }
"$1"
}
__mdw_xterm_precmd () { __mdw_xterm_settitle "$__mdw_shell"; }