zsh: unset empty TMP and TMPDIR
this is a safety mechanism so that `/` is never used
This commit is contained in:
parent
cbd73c7466
commit
028c57b0db
1 changed files with 9 additions and 0 deletions
|
@ -53,6 +53,15 @@ in
|
||||||
inNixShell = ''$([[ -n "$IN_NIX_SHELL" ]] && printf " 🐚")'';
|
inNixShell = ''$([[ -n "$IN_NIX_SHELL" ]] && printf " 🐚")'';
|
||||||
in
|
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 '
|
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=""
|
RPROMPT=""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue