Files
dotfiles/.config/zsh/.zlogout
druckdev 1b17c35f4b 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.
2021-04-12 21:01:31 +02:00

2 lines
49 B
Bash

[[ -z $SSH_AGENT_PID ]] || kill "$SSH_AGENT_PID"