diff --git a/.bash_logout b/.bash_logout index 69c7a92..44a193f 100644 --- a/.bash_logout +++ b/.bash_logout @@ -17,7 +17,7 @@ hash ssh-add ssh-agent >/dev/null 2>&1 && { # Determine the platform we're on. _PLATFORM="$(uname -s)" - # Remove the SSH_AUTH_SOCK from the agents file. + # Remove the $SSH_AUTH_SOCK from the agents file. [[ ! -z "$SSH_AUTH_SOCK" ]] && (( ${_SSH_AGENT_REG_FAILED:-0} == 0 )) && { _lock_agents_file && { _pop_agent_sock || { diff --git a/.bash_profile b/.bash_profile index 41d9842..ad893fe 100644 --- a/.bash_profile +++ b/.bash_profile @@ -34,10 +34,6 @@ fi [[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" [[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" -#When registration of connection fails, set a marker in .bash_profile. -#Check for that marker in .bash_logout and don't remove socket from agents file - would be removing -#another shells socket. Will need to clear the marker if subsequently (from prompt_command) find a new socket and reg it. - # Make ssh-agent work better. hash ssh-add ssh-agent >/dev/null 2>&1 && { if [[ -e "$SSH_AUTH_SOCK" ]]; then diff --git a/.bashrc b/.bashrc index 1f9da64..255a23b 100644 --- a/.bashrc +++ b/.bashrc @@ -24,6 +24,7 @@ _agent_prompt_command() { _unlock_agents_file _SSH_PROMPT_ERROR_ISSUED=0 else + # Failed to find a new socket. if [[ -z "$(egrep -v '^$' ~/.ssh/agents)" ]]; then ((${_SSH_PROMPT_ERROR_ISSUED:-0} == 0)) && { echo "$(tput setaf 1)Lost connection to ssh-agent - no alternate available!$(tput op)"