Skip to content

Add isOutputRedirected parameter to GetFormatStyleString() method - #14397

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:isredirected
Sep 9, 2021
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:isredirected

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 11, 2020 •

Copy link
Copy Markdown
Member

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.Formatting formatting.

PR Checklist

@ghost

Copy link
Copy Markdown

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 backport label.

@ghost ghost added the Review - Needed The PR is being reviewed label Dec 24, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@iSazonov

Copy link
Copy Markdown
Collaborator

The PR should close #14387

@ghost ghost removed the Review - Needed The PR is being reviewed label Mar 6, 2021
@ghost ghost added the Review - Needed The PR is being reviewed label Mar 13, 2021
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Steve Lee (@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?

@daxian-dbw

Copy link
Copy Markdown
Member

The markdown test failed due to a broken link, which has nothing to do with this PR.

@ghost ghost removed the Review - Needed The PR is being reviewed label Sep 8, 2021
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) I think we can defer making those APIs public util we have a host that needs it

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Sep 9, 2021 •

Copy link
Copy Markdown
Member

Steve Lee (@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 $PSStyle not working in the PowerShell sub-kernel.

And, maybe the PSES host will need them too? Rob Holt (@rjmholt) can you please weigh in.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 024f409 into PowerShell:master Sep 9, 2021
@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 9, 2021
@daxian-dbw Dongbo Wang (daxian-dbw) added this to the 7.2.0-rc.1 milestone Sep 9, 2021
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the isredirected branch September 9, 2021 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.2.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants