Files
dotfiles/.config/zsh/.zlogout
druckdev 57f89d34dc zsh:z{profile,logout}: Kill only 'own' ssh-agent
Kill the ssh-agent only if it was created in this session.

Like that the login shell can inherit SSH_AGENT_PID without it killing
the agent at the end. For this to work properly it is important that
LAUNCHED_SSH_AGENT is not exported, otherwise nested login shells will
mess with each other.
2021-06-15 13:19:29 +02:00

3 lines
120 B
Bash

# Kill ssh-agent if it was created in this session
! (( LAUNCHED_SSH_AGENT && SSH_AGENT_PID )) || kill "$SSH_AGENT_PID"