From: Mark Wooding Date: Tue, 8 Aug 2017 16:39:01 +0000 (+0100) Subject: dot/bashrc, dot/shell-rc: Set TMPDIR as common per-shell behaviour. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/5e06367fbf2f35302c42dd9d69802aa52f9391ec?ds=sidebyside dot/bashrc, dot/shell-rc: Set TMPDIR as common per-shell behaviour. This turns out to be necessary to not have pterm forget the temporary directory, so make it common behaviour. --- diff --git a/dot/bashrc b/dot/bashrc index 6d06f7e..28d9bf9 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -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. diff --git a/dot/shell-rc b/dot/shell-rc index 1fa4343..11b9fc7 100644 --- a/dot/shell-rc +++ b/dot/shell-rc @@ -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.