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.
2 lines
49 B
Bash
2 lines
49 B
Bash
[[ -z $SSH_AGENT_PID ]] || kill "$SSH_AGENT_PID"
|