Fixed most problems such as:
gpg: agent_genkey failed: No pinentry
Key generation failed: No pinentry
gpg-agent[339]: smartcard signing failed: Inappropriate ioctl for device
gpg-agent[339]: command 'PKSIGN' failed: Inappropriate ioctl for device <Pinentry>
qgpg-agent[339]: DBG: no device present
Credits go to @DomT4 https://github.com/Homebrew/homebrew-versions/issues/681#issuecomment-77455942
/usr/local/bin/pinentry
does not work well for me. It appears on wrong tty, and key input was interfered.brew install pinentry-mac
and setpinentry-program /usr/local/bin/pinentry-mac
in~/.gnupg/gpg-agent.conf
works well for me.