mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
Fixed gpg-agent plugin not doing what the README says it does.
It now launches the `gpg-agent` executable (via `gpgconf --launch`) when Zsh first starts up. Also updated the README to explain what issues it fixes when the plugin is enabled for better transparency about what the plugin actually does. Signed-off-by: G'lek Tarssza <glek@glektarssza.com>
This commit is contained in:
parent
680298e920
commit
fc2fc9a28c
2 changed files with 9 additions and 2 deletions
|
|
@ -1,6 +1,11 @@
|
||||||
# gpg-agent
|
# gpg-agent
|
||||||
|
|
||||||
Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running.
|
Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running and fixes some common issues.
|
||||||
|
|
||||||
|
Issues fixed are:
|
||||||
|
|
||||||
|
* The `GPG_TTY` environment variable being set incorrectly or not set at all.
|
||||||
|
* SSH agent support being broken when `enable-ssh-support` is enabled.
|
||||||
|
|
||||||
To use it, add `gpg-agent` to the plugins array of your zshrc file:
|
To use it, add `gpg-agent` to the plugins array of your zshrc file:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
export GPG_TTY=$TTY
|
# Launch gpg-agent ahead of time
|
||||||
|
gpgconf --launch gpg-agent
|
||||||
|
|
||||||
# Fix for passphrase prompt on the correct tty
|
# Fix for passphrase prompt on the correct tty
|
||||||
# See https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html#option-_002d_002denable_002dssh_002dsupport
|
# See https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html#option-_002d_002denable_002dssh_002dsupport
|
||||||
function _gpg-agent_update-tty_preexec {
|
function _gpg-agent_update-tty_preexec {
|
||||||
|
export GPG_TTY="${TTY}"
|
||||||
gpg-connect-agent updatestartuptty /bye &>/dev/null
|
gpg-connect-agent updatestartuptty /bye &>/dev/null
|
||||||
}
|
}
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue