Install pinentry-curses.
brew install pinentry-cursesConfigure the agent to use pinentry-curses
echo 'export GPG_TTY=$(tty)' >> ~/.zshrc
echo 'pinentry-program /opt/homebrew/bin/pinentry-curses' > ~/.gnupg/gpg-agent.conf
echo 'allow-loopback-pinentry' >> ~/.gnupg/gpg-agent.conf
killall gpg-agent
source ~/.zshrc
echo test | gpg --clearsignIf using powerlevel10k, add this to ~/.zshrc after the call to source .p10k.sh
# powerlevel10k with instant prompt does not support tty while initilizing
if [ $ZSH_THEME="powerlevel10k/powerlevel10k" ]; then
export GPG_TTY=$TTY
fiInstall pinentry-mac.
brew install pinentry-mac- Create
~/bin/pinentry-selector.shscript
#!/bin/zsh
#
# Needs to have pinentry-mac and pinentry-curses installed with homebrew
#
if [ -n "$VSCODE_PID" ]; then
# if vscode, use pinentry-mac (keychain)
exec /opt/homebrew/bin/pinentry-mac "$@"
else
# by default use the console pinentry
exec /opt/homebrew/bin/pinentry-curses "$@"
fi- Create/edit
~/.gnupg/gpg-agent.conf
pinentry-program ~/bin/pinentry-selector
allow-loopback-pinentry