From 70c91a2239c52ca411b68f32d0845a1c14868d34 Mon Sep 17 00:00:00 2001 From: sev Date: Fri, 23 Aug 2024 12:33:47 -0500 Subject: [PATCH] zshenv: add _sev_proot_old_username for proot tmp --- etc/zsh/.zshenv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.47.0