This is more of a behavior change / regression rather then a bug that I haven't experienced in previous versions. IMO the old behavior is better and safer. It's kind of hard to explain the difference, so I'll list the steps to reproduce and I'll point out how previous gnupg2 versions behaved and how the current version does.
- Login to a bare tty.
- Run gpg --decrypt <file> and be prompted for a password.
- Note with top that gpg-agent is running.
- Run gpg-connect-agent reloadagent /bye
- Run gpg --decrypt <file> and be prompted for a password again.
This behavior is OK IMO and is identical with both older and newer versions of GnuPG2.
Here's what happens if I run at a certain point startx and what happens inside the X session.
- Login to a bare tty.
- Run gpg --decrypt <file> and be prompted for a password.
- Run startx.
- Inside the X session, run gpg-connect-agent reloadagent /bye or any other command that should reload the agent.
- Run gpg --decrypt <file> and you wouldn't be prompted for a password - the contents of <file> will be printed even if you kill the gpg-agent process.
In older versions, even inside an X session these agent controlling commands have enabled me to "lock" my key and thus protect my encrypted files when e.g my screensaver locks my computer. Unfortunatly, I don't remember which version exactly caused the regression - I just update everything with my distro's package manager and it took me a while to notice it and realize this is not an issue with my setup, but an upstream issue.
Other info
I use NixOS. and I don't use the gpg-agent systemd units, trying to enable/start them doesn't make a difference.