X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/8a92a2c03c1ea03829e44bf80771a08153261e2a..c0eb0bfb4a783c14228d08a643d6c269ae021792:/etc/zsh/.zprofile?ds=inline diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index a55b7e6..407c300 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -50,8 +50,9 @@ if [[ ! -v DBUS_SESSION_BUS_ADDRESS && -v commands[dbus-launch] ]] { # therefore, the safest way to ensure unique sockets while not having to # write specific logic for both scenarios is to simply change GNUPGHOME. # the easiest way to do this is to create a new dir and link the contents -# of GNUPGHOME to the new home. we can then replace the agent sockets -# there with the forwarded one. +# of GNUPGHOME to the new home. we can then replace all of the agent +# sockets wherever they now are with the forwarded one. in either case we +# will be overwriting the session-specific sockets. # # NOTE: since Unix sockets are not supported under Windows, this will not work # under msys, cygwin, mingw, etc., but may work under wsl2. @@ -179,7 +180,7 @@ if [[ ! -v _sev_setup_ssh ]] { if [[ -f $e ]] { IFS=$'\0' read -r sock pid <$e } - if [[ -S $sock && $pid > 0 ]] && kill -0 $pid; then + if [[ -S $sock && $pid > 0 ]] && kill -0 $pid >/dev/null 2>&1; then [[ -o interactive ]] && print -P "Reusing agent PID $pid%f" export SSH_AUTH_SOCK=$sock export SSH_AGENT_PID=$pid