I'm trying to get vscode to prompt for passphrase when trying to commit as it does in windows OR at least make the time between having to enter the passphrase a lot longer.
I'm using latest on ubuntu + WSL 2, both installed today.
GPG works in the CLI if I run a test as follows:
echo "test" | gpg --clearsign
I'm being prompted for a passphrase and all is well. Then I'd be able to sign commits in vscode temporarily.
Is there an option to make the time between entering the passphrase a lot longer at least as a workaround?
EDIT:
I also have to enter this everytime I reboot my computer:
export GPG_TTY=$(tty)
Otherwise the above workaround won't work. It's been insane trying to fix this, probably spent at least 1 full day but to no use.
In your ~/.gnupg/gpg-agent.conf
file, add the following:
default-cache-ttl 28800
max-cache-ttl 28800
You can also add the following to your ~/.bashrc
so you do not have to manually enter it each time:
export GPG_TTY=$TTY
echo "test" | gpg --clearsign > /dev/null 2>&1
This prompts me for my password once on start and should cache for 8 hours. The > /dev/null 2>&1
bit hides the output. Currently, this is the workaround I am using--which is not ideal but bearable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With