Browse Source

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').
Marc Cornellà 10 years ago
parent
commit
53c3567cc3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/ssh-agent/ssh-agent.plugin.zsh

+ 1 - 1
plugins/ssh-agent/ssh-agent.plugin.zsh

@@ -7,7 +7,7 @@ function _start_agent() {
 	# start ssh-agent and setup environment
 	zstyle -s :omz:plugins:ssh-agent lifetime lifetime
 
-	ssh-agent ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache
+	ssh-agent -s ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache
 	chmod 600 $_ssh_env_cache
 	. $_ssh_env_cache > /dev/null