keeping your shell connected to an agent

Oct 27, 2014

One of the most annoying things about using an ssh-agent type process is making sure that the environment in your shell (either from an xterm, from an ssh session or embedded in another application) is always properly setup to connect to that process. Since I use gnupg's gpg-agent, I wrote the following shell script (sourced in my ~/.shrc) to try and always do the right thing™: