★ wanayoo — archive 1999 https://github.com/PowerShell/PowerShellEditorServices/pull/897Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and pop dead runspace when using 'attach' for V2 #897

Merged
merged 3 commits into from Mar 29, 2019

Conversation

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Mar 29, 2019

Previously, when you used the attach launch config, if you killed the process that you were attaching to while PSES was attached to it, PSES would go into a bad state and hang forever.

This was because the Runspace wasn't getting cleaned up properly when the connection between the two processes broke.

This change checks for the bad runspace state, cleans up, and pops the bad runspace.

Here's what you see:

[DBG]: [Process:42420]: [Runspace1]: PS /Users/tyler/Downloads/anothertestfunc>> 

Command or script completed.
To end the debugging session type the 'Detach' command at the debugger prompt, or type 'Ctrl+C' otherwise.

Leaving debugged runspace on local machine Tylers-MacBook-Pro
The background process reported an error with the following message: "The named pipe target process has ended.".
At line:0 char:0
PS /Users/tyler/Downloads/anothertestfunc>

which is very consistent with what pwsh.exe shows when this happens.

@TylerLeonhardt
Copy link
Member Author

@TylerLeonhardt TylerLeonhardt commented Mar 29, 2019

I definitely want @SeeminglyScience's green check on this

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

LGTM!

@TylerLeonhardt TylerLeonhardt merged commit 2faa66a into PowerShell:master Mar 29, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
@TylerLeonhardt TylerLeonhardt deleted the TylerLeonhardt:fix-attach-hang-v2 branch Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.