serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Terminal: Kill Shell process before exiting

Open romch007 opened this issue 2 years ago • 2 comments

Fixes #19017

romch007 avatar May 26 '23 18:05 romch007

This is not the correct fix for the referenced issue.

The line that crashes in #19017 is this:

        auto stderr_stream = Core::File::standard_error().release_value_but_fixme_should_propagate_errors();

This is very much a FIXME in LibLine, and should not be papered over by killing the shell unceremoniously in Terminal shutdown.

The code here is trying to open stderr, but it can't open stderr because the terminal already deleted the pty. LibLine should(?) handle stderr/stdout not being openable, or maybe even keep a handle to the "original" stdout/stderr files and assume that a user of LibLine won't change stdout/stderr after creating their line editor.

Alternatively, the Terminal should do something to communicate to the Shell that it's time to exit, and then waitpid until the shell actually exits.

ADKaster avatar May 26 '23 21:05 ADKaster

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jun 28 '23 01:06 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Jul 09 '23 13:07 stale[bot]