Move child exit handling logic to apprt thread

Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
This commit is contained in:
Mitchell Hashimoto
2025-06-27 10:23:21 -07:00
parent 2775792b20
commit 591ef0f40f
7 changed files with 163 additions and 190 deletions

View File

@@ -311,7 +311,6 @@ fn drainMailbox(
.jump_to_prompt => |v| try io.jumpToPrompt(v),
.start_synchronized_output => self.startSynchronizedOutput(cb),
.linefeed_mode => |v| self.flags.linefeed_mode = v,
.child_exited_abnormally => |v| try io.childExitedAbnormally(v.exit_code, v.runtime_ms),
.focused => |v| try io.focusGained(data, v),
.write_small => |v| try io.queueWrite(
data,