diff --git a/.local/bin/homeinit b/.local/bin/homeinit index ef506805..69e64169 100755 --- a/.local/bin/homeinit +++ b/.local/bin/homeinit @@ -146,9 +146,10 @@ if has_gpg_keys; then ## Set up gpg-agent to authenticate to SSH_ROOT. chmod -R go-rwx ~/.gnupg export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - if [ "$GPG_TTY" != "not a tty" ]; then - ## If a TTY, since our ~/.gnupg/gpg-agent.conf exists and specifies a - ## pinentry, we must force the TTY version or else it won't work from a TTY. + if [ "$GPG_TTY" != "not a tty" ] || [ -z "$INSIDE_EMACS" ]; then + ## If a TTY, since our ~/.gnupg/gpg-agent.conf exists and specifies the Emacs + ## pinentry, we must force the TTY version or else it won't work from a TTY. + ## Same if not in Emacs (e.g. Xterm). gpgconf --kill gpg-agent cat<"$(dirname "$PROFILE")/gpg-agent.conf" ## 1-day timeout