Implement 5s timeout for ConPTY handoff embedding.#20051
Open
Kuldeep2822k wants to merge 1 commit intomicrosoft:mainfrom
Open
Implement 5s timeout for ConPTY handoff embedding.#20051Kuldeep2822k wants to merge 1 commit intomicrosoft:mainfrom
Kuldeep2822k wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add a timer in WindowEmperor to automatically exit after 5 seconds if no windows are created during a ConPTY handoff. The timer is cancelled as soon as a new window is created. This prevents the process from staying alive indefinitely if a handoff fails or is never received.
Author
@microsoft-github-policy-service agree |
Member
|
How did you test this? |
Author
I tested this by launching wt.exe -Embedding without sending a handoff signal. The process (PID 18960) exited automatically after ~5 seconds, confirming the SafeDispatcherTimer fires and calls _postQuitMessageIfNeeded() correctly. Without this fix, the process would remain alive indefinitely. |
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.
Add a timer in WindowEmperor to automatically exit after 5 seconds if no windows are created during a ConPTY handoff. The timer is cancelled as soon as a new window is created. This prevents the process from staying alive indefinitely if a handoff fails or is never received.
Summary of the Pull Request
I've implemented a 5-second timeout for the ConPTY handoff embedding in the Windows Terminal.
SafeDispatcherTimer _handoffTimeoutTimer;member to theWindowEmperorclass.HandleCommandlineArgs, when the application is launched with the-Embeddingflag (ConPTY handoff), the timer is started with a 5-second interval._postQuitMessageIfNeeded()to attempt an application exit.CreateNewWindow, the timer is explicitly stopped to ensure that the application doesn't exit if a window is successfully created.The implementation follows the existing codebase patterns using
SafeDispatcherTimerand_postQuitMessageIfNeededReferences and Relevant Issues
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
PR Checklist