From: sev Date: Fri, 23 Aug 2024 17:33:47 +0000 (-0500) Subject: zshenv: add _sev_proot_old_username for proot tmp X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/70c91a2239c52ca411b68f32d0845a1c14868d34 zshenv: add _sev_proot_old_username for proot tmp --- diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index 2cbb88a..69ac9bc 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -156,7 +156,10 @@ if [[ ! -v _sev_setup_path || -o login ]] { if [[ ! -v _sev_tmp ]] { _sev_tmp=~/.local/tmp # create personal TMPDIR under system tmp - t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-$LOGNAME + # NOTE: under proot with uid remapping, we can reuse old tmp, without + # worrying about permission issues; intended for proot under termux. + # XXX: _sev_proot_old_user only works if /tmp is shared! + t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-${_sev_proot_old_username:-$LOGNAME} [[ -e $t ]] || mkdir -m700 $t 2>/dev/null if [[ ! -d $t ]] { # fallback TMPDIR to bare local directory or existing softlink