To change the pinentry permanently, append the following to your ~/.gnupg/gpg-agent.conf
:
pinentry-program /usr/bin/pinentry-tty
(In older versions which lack pinentry-tty, use pinentry-curses for a ‘full-terminal’ dialog window.)
Tell the GPG agent to reload configuration:
gpg-connect-agent reloadagent /bye