1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-15 15:51:42 +00:00

Redirect the output of GPG and SSH agent plugins

This commit is contained in:
Sorin Ionescu
2012-03-07 18:05:01 -05:00
parent 6ac5c25e77
commit 7a745425c4
2 changed files with 5 additions and 7 deletions

View File

@ -30,13 +30,11 @@ function _ssh-agent-start() {
rm -f "${_ssh_agent_env}"
ssh-agent > "${_ssh_agent_env}"
chmod 600 "${_ssh_agent_env}"
source "${_ssh_agent_env}"
source "${_ssh_agent_env}" > /dev/null
# Load identies.
zstyle -a ':omz:plugin:ssh-agent' identities 'identities'
print starting ssh-agent...
if [[ ! -n "${identities}" ]]; then
ssh-add
else
@ -51,7 +49,7 @@ if is-true "${_ssh_agent_forwarding}" && [[ -n "$SSH_AUTH_SOCK" ]]; then
[[ -L "$SSH_AUTH_SOCK" ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen
elif [ -f "${_ssh_agent_env}" ]; then
# Source SSH settings, if applicable.
source "${_ssh_agent_env}"
source "${_ssh_agent_env}" > /dev/null
ps -ef | grep "${SSH_AGENT_PID}" | grep -q 'ssh-agent$' || {
_ssh-agent-start;
}