zsh: Add zlogout to kill ssh-agent
On system where my dotfiles are only partially installed (e.g. only the shell) for the environment variables defined in the zprofile to take affect, every terminal instance needs to execute zsh a login-shell. This lead to numerous instances of the ssh-agent that were not killed when exiting the shell. As I still need the correct env-vars like SSH_AGENT_PID in every shell I cannot just pgrep and execute the agent respectively. This adds a zlogout that kills the agent spawned in the current shell. It also stops `exec`ing `startx` as then the zlogout is not read.
This commit is contained in:
1
.config/zsh/.zlogout
Normal file
1
.config/zsh/.zlogout
Normal file
@@ -0,0 +1 @@
|
||||
[[ -z $SSH_AGENT_PID ]] || kill "$SSH_AGENT_PID"
|
||||
Reference in New Issue
Block a user