# NOTE: /usr/{local,pkg,games} are unix/bsdisms
# XXX: PREFIX not validated, non-posix but Termux uses it
syspath=("$path[@]")
- path=({~,~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/sbin
- {~,~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/bin
+ path=(~/{s,}bin
+ {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/sbin
+ {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/bin
/usr/{X11R{7,6}/bin,games})
((len=$#path))
path=("$path[@]" "$syspath[@]")
}
# shift valid system paths to the front if there are any left
((len > 0 && len < $#path)) && path=("${(@)path[len + 1, -1]}" "${(@)path[1, len]}")
- unset syspath len i j
+ unset syspath len i
# include our zsh dir in fpath. unlike above, we always prefer our paths
fpath=(${ZDOTDIR:-~/.zsh}/functions/{*,Completions/*}(N) "$fpath[@]")
# FPATH is not exported by default
if [[ ! -v SSH_AUTH_SOCK && ( -v commands[okc-ssh-agent] ||
( -v commands[ssh-agent] && ! -v commands[gpg] ) ) ]] {
okc=${commands[okc-ssh-agent]:+okc-}
- t=${_sev_tmp:-${TMPDIR:-${TEMP:-${TMP:-/tmp}}}}
- e=$t/${okc}ssh-agent-exports
+ e=$_sev_tmp/${okc}ssh-agent-exports
typeset sock=
typeset -i pid=
if [[ -f $e ]] {
export SSH_AUTH_SOCK=$sock
export SSH_AGENT_PID=$pid
else
- e='TMPDIR=$t ${okc}ssh-agent'
# TODO: ensure ssh-agent path looks legit to avoid unsafe eval?
# XXX: doesn't appear to be any other way to handle redirection.
# because eval needs to write to current scope environment
# subshells can't be used to capture output and print.
+ c='TMPDIR=$_sev_tmp ${okc}ssh-agent'
if [[ -o interactive ]] {
- eval $(eval $=e)
+ eval $(eval $=c)
print -nP '%f'
} else {
- eval $(eval $=e) >/dev/null 2>&1
+ eval $(eval $=c) >/dev/null 2>&1
}
echo -n $SSH_AUTH_SOCK$'\0'$SSH_AGENT_PID >!$e
+ unset c
fi
- unset okc t e sock pid
+ unset okc e sock pid
} elif [[ ! -v SSH_AUTH_SOCK && -v commands[gpg] ]] {
# since gpg should have been started above, just export and notify
if [[ -o interactive ]] {