If I restart my laptop then commits from Visual Studio Code do not work until I first cache the GPG passphrase within WSL2. I am now able to use the Visual Studio Code git UI and VSCode's built-in terminal to commit changes. Any commit after this no longer prompts for the passphrase.
![code on time error in windows 10 code on time error in windows 10](http://www.4winkey.com/images/article/windows-tips/troubleshoot-of-windows-10-8.jpg)
This passphrase is then cached for the rest of my Windows session until I restart my laptop. │ Please enter the passphrase to unlock the OpenPGP secret key: │ If I run a git commit from within WSL2 in Windows Terminal it prompts me for my passphrase. Pinentry-program /usr/bin/pinentry-cursesĮxport GPG_AGENT_INFO=$/.gnupg/S.gpg-agent:0:1 I have ~/.gnupg/gpg.conf settings use-agentĪnd ~/.gnupg/nf default-cache-ttl 34560000 The git repository is initiated using the command line within WSL2. Git (2.25.1) is installed within WSL2 with the following global config: Visual Studio Code is opened via the command line using the code. My code is within WSL2 running Ubuntu 20.04 with all packages updated.
#Code on time error in windows 10 windows 10
Visual Studio Code is installed within Windows 10 and is the latest version (1.48.0) and includes the latest Remote WSL Extension (v0.44.4). Latest version of Windows 10 with WSL2 and Windows Terminal. No passphrase prompt is shown within Windows 10 resulting in git failing with error: gpg failed to sign the data I am unable to use signed commits within Visual Studio Code when committing code in WSL2 from Windows 10.