53c3567cc395127d6ba90b8a010e8f7a48a16713

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Force ssh-agent output to use bourne-style syntax

On systems where the shell cannot be changed because of a strict
security policy, ssh-agent will use the syntax of whatever the
default $SHELL is.
For instance, if the default shell is tcsh, ssh-agent will use the
c-shell style (setenv).

This change forces ssh-agent to use bourne-style syntax since that
has to be later interpreted by zsh. Consequently, the environment
file will contain `export' statements from now on (instead of
`setenv').

Diff

 1diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
 2index e6bc9c4e682a79b810f7c807905eea75b0c03545..a84aac58ca337d4ecae06928d1b31cb5195ce01c 100644
 3--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
 4+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
 5@@ -7,7 +7,7 @@ function _start_agent() {
 6 	# start ssh-agent and setup environment
 7 	zstyle -s :omz:plugins:ssh-agent lifetime lifetime
 8 
 9-	ssh-agent ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache
10+	ssh-agent -s ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache
11 	chmod 600 $_ssh_env_cache
12 	. $_ssh_env_cache > /dev/null
13