terminal: Fix terminal freeze when child process is killed by signal#47420
Merged
smitbarmase merged 4 commits intomainfrom Jan 25, 2026
Merged
terminal: Fix terminal freeze when child process is killed by signal#47420smitbarmase merged 4 commits intomainfrom
smitbarmase merged 4 commits intomainfrom
Conversation
smitbarmase
added a commit
that referenced
this pull request
Feb 10, 2026
Follow-up to #47420 and #44193. #47420 fixed child-exit status handling via upstream alacritty change (alacritty/alacritty#8825). However, stable/preview/nightly builds still reproduced hangs that dev builds did not. The root cause matches #44193: spawned children inherit crash-handler Mach exception ports and hang. We already reset exception ports in `util::command::new_smol_command` and `util::set_pre_exec_to_start_new_session`, but PTY child spawning in `alacritty_terminal` was not covered. This PR updates `alacritty_terminal` to include PTY `pre_exec` exception-port reset: zed-industries/alacritty@9d9640d Upstream: - alacritty/alacritty#8835 Release Notes: - Fixed terminal tasks hanging on macOS when a spawned process is killed by a signal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #38168
Closes #42414
We were already using
ExitStatusExt::from_raw()to construct anExitStatus, but we were passing in the exit code from alacritty_terminal'sChildExitevent. This worked fine on Windows wherefrom_raw()expects an exit code, but on Unix,from_raw()(read more) expects a raw wait status fromwaitpid()and not an exit code.When a child process was killed by a signal (e.g., SIGSEGV),
ExitStatus::code()returnsNonesince only normal exits have an exit code. This caused the terminal to hang because we weren't properly detecting the exit.One fix would have been to remove the dependency on
ExitStatusentirely, but using the raw wait status gives us more information, we can now detect exit codes, signal terminations, and more.The actual fix was upstream in
alacritty_terminalto send the raw wait status instead of just the exit code.Currently using forked patch https://github.com/zed-industries/alacritty/tree/v0.16-child-exit-patch which is based on v0.25.1.
Upstream PR: alacritty/alacritty#8825
Release Notes: