From fb035522da5807e64e1ccaf7d595b6fcd21649dc Mon Sep 17 00:00:00 2001 From: RIT80 <55622 08+RIT80@users.noreply.github.com> Date: Sun, 30 Sep 2012 17:19:34 -0400 Subject: [PATCH] [Fix #300] Disable SSH-Agent protocol emulation by default --- modules/gpg-agent/README.md | 9 +++++++++ modules/gpg-agent/init.zsh | 10 +++++++++- runcoms/zpreztorc | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/gpg-agent/README.md b/modules/gpg-agent/README.md index e1fc158d441..1b222d46a82 100644 --- a/modules/gpg-agent/README.md +++ b/modules/gpg-agent/README.md @@ -3,6 +3,15 @@ GPG-Agent Provides for an easier use of [gpg-agent][1]. +Settings +-------- + +### SSH-Agent Protocol Emulation + +To enable SSH-Agent protocol emulation, add the following line to *zpreztorc*: + + zstyle ':prezto:module:gpg-agent' ssh-support 'yes' + Authors ------- diff --git a/modules/gpg-agent/init.zsh b/modules/gpg-agent/init.zsh index 902466da91b..6d010d28135 100644 --- a/modules/gpg-agent/init.zsh +++ b/modules/gpg-agent/init.zsh @@ -14,7 +14,15 @@ fi _gpg_env="$HOME/.gnupg/gpg-agent.env" function _gpg-agent-start { - gpg-agent --daemon --enable-ssh-support --write-env-file "${_gpg_env}" > /dev/null + local ssh_support + + zstyle -b ':prezto:module:gpg-agent' ssh-support 'ssh_support' \ + || ssh_support='' + + gpg-agent \ + --daemon ${ssh_support:+'--enable-ssh-support'} + --write-env-file "${_gpg_env}" > /dev/null + chmod 600 "${_gpg_env}" source "${_gpg_env}" > /dev/null } diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index 66cddb52f02..fd17969e974 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -81,6 +81,13 @@ zstyle ':prezto:module:prompt' theme 'sorin' # Auto start a session when Zsh is launched. # zstyle ':prezto:module:screen' auto-start 'yes' +# +# GPG-Agent +# + +# Enable SSH-Agent protocol emulation. +# zstyle ':prezto:module:gpg-agent' ssh-support 'yes' + # # SSH-Agent #