]> git.sev.monster Git - dotfiles.git/commitdiff
zshenv: add TMPPREFIX support
authorsev <git@sev.monster>
Wed, 3 Jan 2024 13:12:09 +0000 (07:12 -0600)
committersev <git@sev.monster>
Fri, 5 Apr 2024 21:27:41 +0000 (16:27 -0500)
etc/zsh/.zshenv

index 0d5807653c59b448bc2d955484c902d1b69fe212..99e3372815bbcbc509fa7b7ca494c5263ebeb95c 100644 (file)
@@ -149,7 +149,7 @@ if [[ ! -v _sev_setup_path || -o login ]] {
 #       chances of that are slim.
 if [[ ! -v _sev_tmp ]] {
     # create personal TMPDIR under system tmp
-    t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-/tmp}}}}/.home-$LOGNAME
+    t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-$LOGNAME
     [[ -e $t ]] || mkdir -m700 $t 2>/dev/null
     _sev_tmp=~/.local/tmp
     if [[ ! -d $t ]] {
@@ -188,7 +188,7 @@ if [[ ! -v _sev_tmp ]] {
               print -P "%F{red}!!! Can't create session tmp subdir $t, using $_sev_tmp%f"
             t=$_sev_tmp
         fi
-        export _sev_tmp TMPDIR=$t TEMPDIR=$t TEMP=$t TMP=$t
+        export _sev_tmp TMPDIR=$t TEMPDIR=$t TEMP=$t TMP=$t TMPPREFIX=$t/zsh
     }
     unset t
 }
This page took 0.036434 seconds and 4 git commands to generate.