From ee0c6a445ad9dc4b663be40754c2ef63a7362b56 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Mon, 16 Jan 2017 05:10:36 +0200 Subject: [PATCH] Disable interactive passwords in SSH for git fetch (#269) This commit fixes a problem where SSH (used by Git) is able to interactively prompt for a password that can not be redirected to `/dev/null`. An interactive SSH password prompt inside the async worker does three things: 1. Leave the `git fetch` hanging due to waiting for input 2. Capture part of the input to the async worker, thus creating nonsense commands 3. Use some characters from future async jobs as a password and attempts to login Even if this was fixed in `zsh-async`, it is still good to disable the password prompt to avoid issue numero uno. --- pure.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index a62a60e..f1fd5cd 100644 --- a/pure.zsh +++ b/pure.zsh @@ -256,7 +256,11 @@ prompt_pure_async_git_fetch() { builtin cd -q "$*" # set GIT_TERMINAL_PROMPT=0 to disable auth prompting for git fetch (git 2.3+) - GIT_TERMINAL_PROMPT=0 command git -c gc.auto=0 fetch + export GIT_TERMINAL_PROMPT=0 + # set ssh BachMode to disable all interactive ssh password prompting + export GIT_SSH_COMMAND=${GIT_SSH_COMMAND:-"ssh -o BatchMode=yes"} + + command git -c gc.auto=0 fetch } prompt_pure_async_tasks() {