I have a bash script (lets call it script.sh)
It launches an ssh session to one of my LAN servers...
---
#/bin/sh
ssh root@nelson
---
I have Alfred set up to allow me to launch this script directly..
This was done by adding 'public.shell-script' into Default Results -> Advanced (just by dragging that script into the pane)
Now, when I launch my SSH session from Alfred in this way, and then exit it by closing the iTerm2 tab, the ssh session remains in the process indefinitely (as a terminated process).
If instead, I end the ssh session by typing 'exit' then it is removed from the process list (as it should be).
Finally, if I launch the script manually from within iTerm (without using Alfred), then likewise it is removed from the process list when it ends
I cant say for certain whether its an Alfred bug or an iTerm2 bug, but my hunch is it might be a combination of the two, but it only manifests itself when launching a script from Alfred.
I only noticed this because I had over 300 terminated ssh sessions in 'ps aux', some dating back a couple of months ago
iTerm2 is *not* configured to use tmux, which would have explained one possible reason why this might happen
Should I be launching ssh from my script in a different way?
Any ideas what could be causing this?
Finally you might ask why I launch a script which simply opens an ssh session
But in reality the script is much more complex. I've just boiled it down to the simplest way to be reproducable
Using OSX: 10.11.5 (El Capitan)
Alfred: v3.0.3 [694] Powerpack
Thanks