Change $TMPDIR for non-interactive shells

This commit changes the way $TMPDIR is set by using `mktemp` rather
than a fixed string.
This commit is contained in:
Jared Scott 2016-10-12 00:54:11 -04:00 committed by Kaleb Elwert
parent dcd8596192
commit 3a6ae0fc6c

View file

@ -67,8 +67,7 @@ fi
#
if [[ ! -d "$TMPDIR" ]]; then
export TMPDIR="/tmp/$LOGNAME"
mkdir -p -m 700 "$TMPDIR"
export TMPDIR="$(mktemp -d)"
fi
TMPPREFIX="${TMPDIR%/}/zsh"