zshrc: fix zstyle ssh-agent forward option

It appears that during rearranging yonks ago we accidentally sourced
oh-my-zsh before we set this setting, leading to the ssh-agent _always_
creating a new agent, even when SSH_AUTH_SOCK had already been set.

This a fairly minor problem, but it does leave to session lingering, and
breaks programs that manage ssh-agent identities, like gnome-keyring, or
systemd user session ssh-agent services.
This commit is contained in:
Paul Stemmet 2022-08-17 15:04:41 +00:00
parent 78d01decfb
commit ca9d31b178
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 1 additions and 2 deletions

3
zshrc
View File

@ -136,6 +136,7 @@ fi
if [[ -d ~/.ssh ]]
then
zstyle :omz:plugins:ssh-agent lifetime 36h
zstyle :omz:plugins:ssh-agent agent-forwarding on
if [[ -e ~/.ssh/autoload ]]
then
zstyle :omz:plugins:ssh-agent identities $( cat ~/.ssh/autoload )
@ -144,8 +145,6 @@ fi
[[ -d $ZSH ]] && source $ZSH/oh-my-zsh.sh
zstyle :omz:plugins:ssh-agent agent-forwarding on
# Dynamic Completion
foreach cmd in kubectl kubeadm
( which $cmd &>/dev/null ) && source <($cmd completion zsh)