danhper / danhper/fish-ssh-agent
(Re)starting multiple terminal windows race condition
- Dominant language
- Shell
- Stars
- 375
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
I've noticed that when I restart my computer and have the terminal windows restored (I have multiple terminals in iTerm and some in VSCode), I start getting errors like:
```
fish: Unknown command: nv
~/.ssh/environment (line 4):
nv SSH_AGENT_PID 1013;
^
from sourcing file ~/.ssh/environment
called on line 3 of file ~/.config/fish/functions/__ssh_agent_is_started.fish
in function '__ssh_agent_is_started'
called on line 5 of file ~/.config/fish/conf.d/fish-ssh-agent.fish
from sourcing file ~/.config/fish/conf.d/fish-ssh-agent.fish
called on line 246 of file /opt/homebrew/Cellar/fish/3.5.1/share/fish/config.fish
from sourcing file /opt/homebrew/Cellar/fish/3.5.1/share/fish/config.fish
called during startup
```
My `~/.ssh/environment` file looks like:
```
setenv SSH_AUTH_SOCK /tmp/ssh-xo1lUD2fkYK4/agent.1003;
setenv SSH_AGENT_PID 1017;
#echo Agent pid 1017;
nv SSH_AGENT_PID 1013;
#echo Agent pid 1013;
```
It seems then that multiple terminals are starting up the ssh agent at the same time and trying to write to the same lock file.
I can also confirm I do have two SSH agents running:
```
1013 ?? Ss 0:00.01 ssh-agent -c
1017 ?? Ss 0:00.00 ssh-agent -c
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.