chiark / gitweb /
dot/infokey: Configure the standalone Info reader a bit.
[profile] / dot / shell-rc
index 1fa43438241bb5c8cc88dbb73ef205b05011ea41..ac8819dcbe0a1fa3e5ab02bd8563114b15f0e65d 100644 (file)
@@ -14,6 +14,10 @@ __mdw_source_if_exists () {
   done
 }
 
+## Set the temporary directory again.  (A setuid or setgid program may have
+## unhelpfully forgotten this for us.)
+case ${TMPDIR+t} in t) ;; *) eval $(tmpdir -b); esac
+
 ###--------------------------------------------------------------------------
 ### Prompt machinery.
 
@@ -33,7 +37,7 @@ __mdw_set_prompt_pieces () {
   ## 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}
+  user=${USER-${LOGNAME-$(id -un)}}
   case $(id -u) in
     0)
       left=$(echo « | iconv -f UTF-8 -t //translit)