# create personal TMPDIR under system tmp
# NOTE: under proot with uid remapping and shared /tmp, we can reuse old
# dir, without worrying about permission issues; intended for termux.
# create personal TMPDIR under system tmp
# NOTE: under proot with uid remapping and shared /tmp, we can reuse old
# dir, without worrying about permission issues; intended for termux.
- t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-${_sev_proot_real_user:-$LOGNAME}
- [[ -e $t ]] || mkdir -m700 $t 2>/dev/null
- if [[ ! -d $t ]] {
+ _t=${TMPDIR:-${TEMPDIR:-${TEMP:-${TMP:-${${TMPPREFIX%/zsh}:-/tmp}}}}}/.home-${_sev_proot_real_user:-$LOGNAME}
+ [[ -e $_t ]] || mkdir -m700 $_t 2>/dev/null
+ if [[ ! -d $_t ]] {
[[ -h $_sev_tmp && ! -d _sev_tmp ]] && unlink $_sev_tmp 2>/dev/null
[[ ! -e $_sev_tmp ]] && mkdir -m700 $_sev_tmp 2>/dev/null
if [[ ! -d $_sev_tmp ]] {
[[ -h $_sev_tmp && ! -d _sev_tmp ]] && unlink $_sev_tmp 2>/dev/null
[[ ! -e $_sev_tmp ]] && mkdir -m700 $_sev_tmp 2>/dev/null
if [[ ! -d $_sev_tmp ]] {
[[ -o interactive ]] &&
print -P "%F{orange}*** $_sev_tmp links to ${_sev_tmp:P} and not ${t:P}, unlinking it%f"
# NOTE: ln -f doesn't seem to work reliably with softlink
[[ -o interactive ]] &&
print -P "%F{orange}*** $_sev_tmp links to ${_sev_tmp:P} and not ${t:P}, unlinking it%f"
# NOTE: ln -f doesn't seem to work reliably with softlink