contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.37k stars 102 forks source link

pragmatic fix of shell quick exit #1330

Closed christianparpart closed 9 months ago

christianparpart commented 9 months ago

NOTES

We're having two events to watch out for. PTY may be closed and the process may exit. One does not imply the other. We are about to consider the PTY session to be finished whenever one of those two conditions arise, no matter which one comes in first. Sometimes (e.g. quick exit, e.g. just spawning /bin/true as shell) the process will terminate so fast, that we didn't even fully initialize the GUI. We need to properly terminate on that condition as well as expect that both events (PTY closed and process terminated) happens at the same time. Both events call onClosed(). This is why i've guarded it with a mutex to avoid concurrent calling (which happened before).