-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add isOutputRedirected parameter to GetFormatStyleString() method
#14397
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
Conversation
|
Open PRs should not be assigned to milestone, so they are not assigned to the wrong milestone after they are merged. For backport consideration, use a |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
b5a6f30 to
9fb8e62
Compare
|
The PR should close #14387 |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
9fb8e62 to
e5c4a60
Compare
daxian-dbw
left a comment
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.
@SteveL-MSFT Sorry that I lost track of this PR. The changes look good to me, but it doesn't address all the issues tracked in #14387.
I think we need to make GetOutputString and GetFormatStyleString public, so that other host implementation can behave just like the console host. Otherwise, other hosts will have to copy the source code of those 2 methods. What do you think?
|
The markdown test failed due to a broken link, which has nothing to do with this PR. |
… instead of checking within the method
e5c4a60 to
62941e4
Compare
|
@daxian-dbw I think we can defer making those APIs public util we have a host that needs it |
|
@SteveL-MSFT The host of PowerShell Jupyter kernel will need them. Once .NET interactive adopts PowerShell 7.2, it will be a matter of time for users to open the issue about And, maybe the PSES host will need them too? @rjmholt can you please weigh in. |
PR Summary
Based on this feedback #13758 (review), instead of checking if output is redirected within the engine, made it a parameter so that the console host and pass that information (and other hosts can do the same).
Also fixed an error in
$PSStyle.Formattingformatting.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.