ego icon indicating copy to clipboard operation
ego copied to clipboard

ego kills terminal

Open yacc143 opened this issue 2 years ago • 4 comments

Hi!

I start a second user session like this, on Fedora 35:

ego -u guest --sudo gnome-terminal

Works mostly fine (beside that the audio forwarding does not work reliably, but I can live with that).

From the gnome-terminal I then start other software, e.g. google-chrome, etc.

Now, I had the effect always, but lately, it has gone from seldom to almost daily, that the gnome-terminal dies at some point, taking with it all started programs.

More funny is that the terminal tab of the host account where I launched ego is also gone.

I can understand that the “child programs” get terminated for whatever reason, but I personallly do not understand the mechanism how the terminal that ego was started in gets killed?

yacc143 avatar May 26 '22 12:05 yacc143

More funny is that the terminal tab of the host account where I launched ego is also gone.

Huh... You launch a shell (bash?) in the terminal, then call ego from the shell? Yeah, if ego dies, it should drop you back into the shell.

Can you see anything in your logs (journalctl etc) that might indicate the reason for this?

intgr avatar May 26 '22 12:05 intgr

I'll watch out for it the next time, especially if I notice it timely.

And yes I launch it to be precise: gnome-terminal in my main account -> bash -> shell script that contains the commands mentioned above (run by bash)

And yes, the tab in the main gnome-terminal is gone, and if other processes (e.g. my openvpn connection) were running in that bash, they are also gone.

Am Do., 26. Mai 2022 um 14:24 Uhr schrieb Marti Raudsepp < @.***>:

More funny is that the terminal tab of the host account where I launched ego is also gone.

Huh... You launch a shell (bash?) in the terminal, then call ego from the shell? Yeah, if ego dies, it should drop you back into the shell.

Can you see anything in your logs (journalctl etc) that might indicate the reason for this?

— Reply to this email directly, view it on GitHub https://github.com/intgr/ego/issues/91#issuecomment-1138522557, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH5B3H537OP4GC72MCKIYLVL5UPRANCNFSM5XBABDYQ . You are receiving this because you authored the thread.Message ID: @.***>

yacc143 avatar May 27 '22 08:05 yacc143

For anyone else running into this, this appears to be an interaction between specifically gnome-terminal and the way that ego determines when to exit. (I've encountered the same issue with gnome-terminal and xpra with xpra's --exit-with-child mode, so it may not be something that ego can reasonably deal with.)

When run from the command-line, gnome-terminal starts a terminal process in the background, disowns it, and then returns to the caller; ego then sees that the command has completed, and I assume that it tears down the session, killing the background terminal process and any other processes that you've started.

It appears that this behavior can be changed in gnome-terminal using the --wait CLI argument, which makes the gnome-terminal command wait to exit until the terminal itself has closed.

The simple fix is to launch gnome-terminal with ego gnome-terminal --wait, or to run ego bash and then launch gnome-terminal from there, making sure not to exit the local bash shell.

Aeledfyr avatar Jan 12 '24 17:01 Aeledfyr

For anyone else running into this, this appears to be an interaction between specifically gnome-terminal and the way that ego determines when to exit. (I've encountered the same issue with gnome-terminal and xpra with xpra's --exit-with-child mode, so it may not be something that ego can reasonably deal with.)

This is plausible, I have not witnessed this yet since I switched to KDE and thus konsole as my terminal application.

The simple fix is to launch gnome-terminal with ego gnome-terminal --wait, or to run ego bash and then launch gnome-terminal from there, making sure not to exit the local bash shell.

I haven't tried this, but yes, in the past I have observed that ego bash seemed to have helped.

yacc143 avatar Jan 12 '24 18:01 yacc143