Skip to content

Commit 281e4c2

Browse files
authored
🐛 fix memory leak of ssh-agents
1 parent 03337a5 commit 281e4c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.additional_bashrc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ alias xdebug-toggle='test $(php -m | grep xdebug) && xdebug-disable && echo "xde
2626

2727
# Run SSH Agent and add key 7d
2828
if [ -z "$SSH_AUTH_SOCK" ] ; then
29-
eval `ssh-agent -s`
29+
eval `ssh-agent -s` >&/dev/null
30+
# on exit of this shell stop the current ssh-agent
31+
trap 'ssh-agent -k; exit' 0
3032
if [ -f ~/.ssh/id_rsa ]; then
3133
ssh-add -t 604800 ~/.ssh/id_rsa
3234
fi

0 commit comments

Comments
 (0)