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
Add additional platform check for Windows before launching native app. #19812
Conversation
This change ensures that we do not get the cursor position in preparation for the BufferCell call since it is only supported on Windows. On non-Windows machines this might also cause problems for applications such as �xpect in which pwsh runs in a session connected by a pty. This change should address the misbehavior described in issue PowerShell#18874.
| @@ -1691,7 +1691,7 @@ private void CalculateIORedirection(bool isWindowsApplication, out bool redirect | |||
|
|
|||
| if (_runStandAlone) | |||
| { | |||
| if (s_supportScreenScrape == null) | |||
| if (s_supportScreenScrape == null && Platform.IsWindows) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we use #if !UNIX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion was made by @SeeminglyScience in conversation to do it this way - I'll let the two of you sort out this conflicting feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion was made by @SeeminglyScience in conversation to do it this way - I'll let the two of you sort out this conflicting feedback
That was based on the assumption that RuntimeInformation.IsOSPlatform was a JIT intrinsic, which doesn't seem to be true anyway (even if it were used here). The ifdef is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@JamesWTruher Please take a look at the CI failures. |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 👌 👎 (Email) |
|
Handy links: |
PR Summary
Fix #18874
This change ensures that we do not get the cursor position in preparation for the BufferCell call since it is only supported on Windows. On non-Windows machines this might also cause problems for applications such as
expectin which pwsh runs in a session connected by a pty. This change should address the misbehavior described in issue #18874.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).