zsh: unset empty TMP and TMPDIR

this is a safety mechanism so that `/` is never used
This commit is contained in:
steveej 2024-02-08 13:58:05 +01:00
parent 7b1b54ac9f
commit a9218a80e6

View file

@ -53,6 +53,15 @@ in
inNixShell = ''$([[ -n "$IN_NIX_SHELL" ]] && printf " 🐚")'';
in
''
if test ! -n "$TMPDIR" -a -z "$TMPDIR"; then
unset TMPDIR
fi
if test ! -n "$TMP" -a -z "$TMP"; then
unset TMP
fi
PROMPT='%F{%(!.red.green)}%n%f@%m %(?.%F{green}%f.%F{red} ($?%))%f %F{blue}%~%f${inNixShell}%F{magenta}$(git_prompt_info)%f$prompt_newline%_%F{%(!.red.green)}$(prompt_char)%f '
RPROMPT=""