User Tools

Site Tools


windows:wsl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
windows:wsl [2019-08-11 01:01] – ssh-agent hack gabrielwindows:wsl [2019-08-18 22:18] – [Using ssh-agent with multiple shell sessions] updated to include check for open shells gabriel
Line 34: Line 34:
  
 <code> <code>
-# start ssh-agent +# start ssh-agent for WSL 
-SSHAGENTINFO=/tmp/${USER}-ssh-agent/info+SSHAGENTINFO=/tmp/${USER}-ssh-agent/conf
 if [ -f $SSHAGENTINFO ]; then if [ -f $SSHAGENTINFO ]; then
   printf "Reading ssh-agent socket info from %s.\n" $SSHAGENTINFO   printf "Reading ssh-agent socket info from %s.\n" $SSHAGENTINFO
Line 48: Line 48:
  
 <code> <code>
-# shut down our ssh-agent when we close the shell +# shut down our ssh-agent when we close the final shell 
-ssh-agent -k && rm -f /tmp/${USER}-ssh-agent/info+SHELLPIDS=$( pgrep bash ) 
 +SHELLCOUNT=$( echo $SHELLPIDS | wc -w ) 
 +if [[ $SHELLCOUNT -eq 1 ]]; then 
 +  ssh-agent -k && rm -f /tmp/${USER}-ssh-agent/conf 
 +fi
 </code> </code>
windows/wsl.txt · Last modified: 2019-08-18 22:20 by gabriel