Quote:
If you run the cygwin X server, then you can just run bash inside an xterm or rxvt or whatever. It almost, almost feels like a normal Unix situation except key things are broken. Most notably (to me, at any rate), if I start up ssh-agent and then run another xterm, it doesn't inherit the environment variables from the old shell, so I have to set the appropriate environment variables in the new shell.
+1
To make ssh-agent work in a shell that was spawned by a process that didn't know about the ssh-agent, put something like this in your .bashrc (i use zsh, dunno if any part of this won't work in bash):
Code:
start-agent ()
{
if [[ -f ~/.ssh-auth ]]; then
. ~/.ssh-auth
[[ -e $SSH_AUTH_SOCK ]] && return
fi
eval $(ssh-agent) >/dev/null
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" > ~/.ssh-auth
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> ~/.ssh-auth
[[ -n $DISPLAY ]] && ssh-add < /dev/null || ssh-add
}
kill-agent ()
{
if [[ ! -z $SSH_AGENT_PID ]]; then
rm -f ~/.ssh-auth
kill -9 $SSH_AGENT_PID
rm $SSH_AUTH_SOCK
unset SSH_AUTH_SOCK SSH_AGENT_PID
fi
}
start-agent
Now the "start-agent" function will check if there's a running agent, connect to the running one if there is, or otherwise start one (and add your default key). "kill-agent" will terminate the running agent if you want to for some reason.
To pass an environment variable (like XUSERFILESEARCHPATH) to all X programs, not just new shells, set it in your window manager startup script (.fvwmrc for me).
_________________________
MkIIa #40104178, 22GB