-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spurious "gpg-agent might not work" message #1
Comments
As indicated in gpg-agent(1),
While it may work without that, it may not. I can change the message from an "error" to a "warning" though, since it's not a black & white matter. |
Ok. In this case (thank god for progress) the gpg agent in question is launched when logging into a GNOME desktop. I would like to think that the thing has been properly initialized; certainly popup dialogs for passphrases occur on the correct $DISPLAY. So all in all this seems like an under-the-hood detail that should just be taken care of by gdm or gpg or both. Regardless, sure, I can set the variable in .bash_profile, but yes, a warning would seem better. Especially since absolutely no one is going to have that variable set by default seeing as how most of us are using our login manager's desktop environment. AfC |
Ah, there's actually a bug here. There's code to automatically set GPG_TTY if it isn't set, but the way it is written will never work correctly. I'll fix that, change the highlighting to a warning, and combine the two warning messages into one so that you see more than just "gpg-agent might not work." in this specific situation. |
It's possible that gpg will work fine without $GPG_TTY being set (e.g., when using a GUI pinentry program). Therefore, the message should be classified as a warning, not an error. Also, use a single :echom to ensure the user sees the entire message, not just "gpg-agent might not work." First part of GH #1 Signed-off-by: James McCoy <vega.james@gmail.com>
Using system('tty') will always report "not a tty", since the spawned shell has stdin redirected. In order to get an accurate value for $GPG_TTY when it's not already set, read the output of the tty command using :!. This requires a bit more setup/teardown to ensure the buffer and user's undo state aren't affected, but it's the only way to accurately determine the user's tty. Closes: #1 Signed-off-by: James McCoy <vega.james@gmail.com>
Very nicely done. Just tested it, works much more cleanly. Time to blog about this :) AfC |
When starting up, you get an error message in red reverse video saying "gpg-agent might not work." and then ... it works. This is especially evident when you edit a new empty file with a
.asc
suffix; the message holds on the status line.AfC
The text was updated successfully, but these errors were encountered: