Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set GPG_TTY when invoking gpg-connect-agent
We have seen user reports having issues with PIN entry not working properly in headless environments or when the moon enters a certain phase. While somewhat hard to reproduce or isolate, setting the GPG_TTY environment variable more often than not seems to resolve them. According to gpg-agent(1), this variable should be initialized with the output of tty(1). That is strictly speaking a step that users need to take, but given that it is more or less an implementation detail that we may end up using GPG agent for PIN entry, they may be excused for not having everything set up and should not be presented with a nondescript error. Of course, such a variable should not be required to begin with, but that ship sailed... Be that as it may, the most sensible (read: user-friendly) step to take from our side is to set the variable if it is not already present. To that end, we essentially query the current TTY as tty(1) would and set GPG_TTY before interacting with gpg-agent.
- Loading branch information