Skip to content

Commit

Permalink
Fixes #8 Skip over invalid processes while looking for an ssh-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
markfinal committed Oct 17, 2022
1 parent d6acf9c commit ab762ec
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cruiz/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,14 @@ def _configure_ssh_agent_statusbar(self) -> None:
ssh_agent_color = "red"
# find the ssh-agent if it is running
for process in psutil.process_iter():
if "ssh-agent" in process.name():
ssh_agent_pid = process.pid
ssh_agent_text = "SSH agent detected"
ssh_agent_color = "darkorange"
break
try:
if "ssh-agent" in process.name():
ssh_agent_pid = process.pid
ssh_agent_text = "SSH agent detected"
ssh_agent_color = "darkorange"
break
except psutil.NoSuchProcess:
continue
if ssh_agent_pid:
try:
ssh_add_list_capture = subprocess.run(
Expand Down

0 comments on commit ab762ec

Please sign in to comment.