Implement 5s timeout for ConPTY handoff embedding. - #20051
Conversation
@microsoft-github-policy-service agree |
|
How did you test this? |
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. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Head branch was pushed to by a user without write access
This comment has been minimized.
This comment has been minimized.
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
did you fix the code format by eye or by using one of our code formatting scripts... |
|
(i ask since it failed again) |
|
I fixed it by eye — I didn't use your code formatting scripts. Here's what I did: Identified the CI failure: "Code Health Check Code Format failed" this was done because i use linux |
|
you know, clang-format runs on linux... |
|
as long as you don't munge the line endings :) |
|
from what i understand it i ran |
|
this is not a spelling check failure. that script will not help you. |
oh sorry i missed that i was trying to run but it kept failing so i tried a general approach |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5e124f2 to
8f1cf6b
Compare
|
i have resolved the spell check issue now it cleared without any issue can you check @DHowett |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
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