Sleep for 0.5s after some ssh agents output.

This commit is contained in:
Darren 'Tadgy' Austin 2023-09-30 12:13:31 +01:00
commit 83a415fd21

View file

@ -199,15 +199,18 @@ __ssh_agent_prompt_command() {
# Find a new socket to use.
if __find_ssh_agent_sock; then
printf "\\033[1;33;40m%s\\033[0;39m\\n" "Connected to existing ssh-agent socket."
sleep 0.5
else
# Start a new agent.
eval "$(ssh-agent -s 2>/dev/null | grep -v 'echo'; printf "%s" "ERR=${PIPESTATUS[0]}")"
(( ERR > 0 )) && {
printf "\\033[1;31;40m%s\\033[0;39m\\n" "Failed to start new ssh-agent - continuing with no agent."
sleep 0.5
return 1
}
printf "\\033[1;32;40m%s\\033[0;39m\\n" "Started new ssh-agent."
__write_ssh_agents
sleep 0.5
fi
}
return 0