Slight change to my previous message:
if [ -n "$STY" ]; then function fix_ssh_auth_sock() { screen -S $STY -X colon "msgwait 0\r" export SSH_AUTH_SOCK=`screen -S $STY -Q echo '$SSH_AUTH_SOCK\r'` screen -S $STY -X colon "msgwait 5\r" } export PROMPT_COMMAND=fix_ssh_auth_sock fi You need to check $STY or it'll start screen recursively!
signature.asc
Description: PGP signature