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

turn off non-windows gate for attach to process #1736

Merged

Conversation

TylerLeonhardt
Copy link
Member

PR Summary

As of 6.2.0-preview.4 Enter-PSHostProcess and Get-PSHostProcessInfo both work on Non-Windows so I've modified the check to allow folks with 6.2.0 and higher to use the Attach to process debug config.

We try to only support the latest preview of PowerShell since it gets hairy to maintain all of the previews... if you feel like I should make the check more robust, let me know! However, I don't know the % of people who would be on preview.X and try using Enter-PSHostProcess.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@@ -68,7 +68,8 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
const platformDetails = getPlatformDetails();
const versionDetails = this.sessionManager.getPowerShellVersionDetails();

if (platformDetails.operatingSystem !== OperatingSystem.Windows) {
// Cross-platform attach to process was added in 6.2.0-preview.4
if (versionDetails.version < "6.2.0" && platformDetails.operatingSystem !== OperatingSystem.Windows) {
const msg = "Attaching to a PowerShell Host Process is supported only on Windows.";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should change this message to indicate it's is supported on Windows and PowerShell Core >= 6.2.0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow duh. Thoughts on this?

Suggested change
const msg = "Attaching to a PowerShell Host Process is supported only on Windows.";
const msg = "Attaching to a PowerShell Host Process is supported on Windows and PowerShell Core 6.2 and up on Non-Windows.";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this instead:

Attaching to a PowerShell Host Process on ${osName} requires PowerShell 6.2 or higher.

Copy link
Collaborator

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Jan 29, 2019

Proof:
image
(I removed the single quotes though)

@TylerLeonhardt TylerLeonhardt merged commit 8ca1509 into PowerShell:master Jan 30, 2019
@TylerLeonhardt TylerLeonhardt deleted the turn-off-non-windowsgate branch January 30, 2019 18:19
TylerLeonhardt added a commit that referenced this pull request Feb 2, 2019
* turn off non-windows gate for attach to process

* address feedback

* no single quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants