my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
675 B

3 years ago
  1. export GPG_TTY=$TTY
  2. # Fix for passphrase prompt on the correct tty
  3. # See https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html#option-_002d_002denable_002dssh_002dsupport
  4. function _gpg-agent_update-tty_preexec {
  5. gpg-connect-agent updatestartuptty /bye &>/dev/null
  6. }
  7. autoload -U add-zsh-hook
  8. add-zsh-hook preexec _gpg-agent_update-tty_preexec
  9. # If enable-ssh-support is set, fix ssh agent integration
  10. if [[ $(gpgconf --list-options gpg-agent | awk -F: '$1=="enable-ssh-support" {print $10}') = 1 ]]; then
  11. unset SSH_AGENT_PID
  12. if [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]]; then
  13. export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
  14. fi
  15. fi