summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zshfunc/ssha8
-rw-r--r--zshrc1
2 files changed, 9 insertions, 0 deletions
diff --git a/zshfunc/ssha b/zshfunc/ssha
new file mode 100644
index 0000000..57f3e87
--- /dev/null
+++ b/zshfunc/ssha
@@ -0,0 +1,8 @@
+## vim:ft=zsh:foldmethod=marker
+
+local SSH_AUTH_SOCK
+local SSH_AGENT_PID
+eval `ssh-agent`
+ssh-add -c
+ssh -o ControlPath=none -A "$@"
+kill $SSH_AGENT_PID
diff --git a/zshrc b/zshrc
index bc9767c..ca56e5e 100644
--- a/zshrc
+++ b/zshrc
@@ -171,6 +171,7 @@ fi
autoload -U compinit
compinit
+compdef _ssh ssha=ssh
#######################################################################
#######################################################################