Repository navigation
Conversation
…ched daemon on Windows
This branch has not been deployed
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.
Issue for this PR
Closes #65662
Type of change
What does this PR do?
On Windows the daemon now calls
SetConsoleCtrlHandler(None, FALSE)once at start, inserver::runbefore any terminal starts (newplatform::accept_ctrl_cindaemon/windows.rs). This clears the "ignore Ctrl+C" attribute it got from being started detached in a new process group. Terminals inherit the attribute, so until now Ctrl+C never reached a program in one. The server's in-process terminal does the same incore/src/pty/pty.bun.ts.The daemon has no console of its own, so no Ctrl+C event reaches the daemon itself, and handlers stay registered. macOS and Linux are untouched: the call is
cfg(windows), andWin32_System_Consoleis added to the Windows-onlywindows-sysfeatures.How did you verify your code works?
ctrl_c_stops_a_program_in_a_terminal_of_a_detached_daemonintests/windows-daemon.rs. It starts the daemon as Node'sdetacheddoes (DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP), runsping -n 30 127.0.0.1in a terminal, writes\x03, and expects ping to exit within 10 s. Ignoring Ctrl+C, ping runs its 30 echoes.rustfmt --checkon the changed files. I have not built the daemon locally; the Windows job ofcheck-process-daemon.ymlcompiles and runs it.Screenshots / recordings
No picture: the change is what a terminal's program does on Ctrl+C, which the test above checks.
Checklist