A workaround for people who prefer entering password in tty when possible (e.g. using pinentry-mode loopback
) but don't want to break vscode commit signing:
- Create a
~/.local/bin/my-pinentry.sh
:
#!/bin/sh
if [ "$PINENTRY_USER_DATA" = "tty" ]; then
exec /usr/bin/pinentry-tty "$@"
else
exec /usr/bin/pinentry "$@"
fi
chmod +x ~/.local/bin/my-pinentry.sh
- Ensure the following line exist in your
~/.gnupg/gpg-agent.conf
:
pinentry-program /home/YOUR_USERNAME/.local/bin/my-pinentry.sh
- Put
export PINENTRY_USER_DATA=tty
in your.zshrc
or.bashrc
(or others depends on your shell)