I am trying to configure Gpg4win to not use the popup window to ask for a passphrase. I only use gpg2 from the command prompt, which means the popup window is both annoying and disruptive since it takes focus away from the command prompt and doesn't give it back afterwards.
This is on Windows 10.
I have tried editing the gpg-agent.conf file with the following content:
pinentry-program C:\...path-to\pinentry.exe
In the hopes that the pinentry.exe with no -w32 or similar ending is the one that will be used on the console but when trying to sign a test file it just sits there for a few seconds and then outputs:
$ gpg2 --sign test.md
gpg: problem with the agent: No pinentry
gpg: no default secret key: Operation cancelled
gpg: signing failed: Operation cancelled
I tried adding quotes around the path and forward slashes so I tried all of the following:
pinentry-program 'C:\...path-to\pinentry.exe'
pinentry-program C:/...path-to/pinentry.exe
pinentry-program file://C:/...path-to/pinentry.exe
In my gpg.conf file the setting use-agent is already commented out, as I found a tip on various websites about but I suspect this is an older setting for gpg (1) and not for gpg2.
I tried adding no-use-agent to the gpg.conf instead and got this:
gpg: C:/.../gpg.conf:202: obsolete option "--no-use-agent" - it has no effect
So is this possible at all?
Basically what I want is that this command:
gpg2 --sign test.md
Should prompt for my passphrase in the same command prompt window before continuing.