dot/bashrc, dot/shell-rc: Set TMPDIR as common per-shell behaviour.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 8 Aug 2017 16:39:01 +0000 (17:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 8 Aug 2017 16:39:01 +0000 (17:39 +0100)
This turns out to be necessary to not have pterm forget the temporary
directory, so make it common behaviour.

dot/bashrc
dot/shell-rc

index 6d06f7e..28d9bf9 100644 (file)
@@ -22,10 +22,6 @@ __mdw_source_if_exists /etc/bashrc
 ## Completion.
 __mdw_source_if_exists /etc/bash_completion "$HOME/.bash_completion"
 
-## Set the temporary directory again.  (If we've switched users, we'll want a
-## different temporary directory.)
-case ${TMPDIR+t} in t) ;; *) eval $(tmpdir -b); esac
-
 ###--------------------------------------------------------------------------
 ### Prompt hacking.
 
index 1fa4343..11b9fc7 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.