-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing a tab or the window does not result in a logout #7826
Comments
Is this not what happens when you close an xterm or gnome-terminal? I am not certain that shells typically react to SIGHUP by processing their logout scripts. Does this work as expected elsewhere? |
My Debian box autostarts |
So, alright. There's a combination of issues here.
This behavior can be recapitulated in gnome-terminal if you toggle the "start ... as login shell" option: exiting the tab unceremoniously does not result in I'm going to close this bug as by-design, but with a quick suggestion: It may be possible to cache the output of
(admittedly, this is for zsh instead of bash.) It caches the agent info in This seems a little cleaner than having one agent per shell instance, and presuming that I launch a lot of shells it's a reasonable savings of resources spent. |
I have Debian installed (
uname -a
returnsLinux Arcadia 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 GNU/Linux
), and I was in the process of getting all of my SSH stuff setup when I noticed that my.bash_logout
(where I kill the instance ofssh-agent
that was started on login) wasn't getting executed if I closed a tab or exited Windows Terminal. After a couple of opens and closes, I've got five or six instances ofssh-agent -s
running.If I explicitly call
logout
, the window closes and I can open a new one to see that the previous instance was correctly killed as desired.Environment
Steps to reproduce
Add the following to ~/.bashrc:
Add the following to ~/.bash_logout
Close Windows Terminal.
Open Windows Terminal.
Close Windows Terminal.
Open Windows Terminal.
Execute
ps aux | grep ssh-agent
.Expected behavior
There should be only one instance of
ssh-agent
running.Actual behavior
There are multiple instances of
ssh-agent
still running.The text was updated successfully, but these errors were encountered: