question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$Host.PrivateData colors are completely broken in PowerShell 7.2

See original GitHub issue

Prerequisites

Steps to reproduce

$PSStyle has completely broken the PrivateData colors. Setting them no longer changes anything.

image

Expected behavior

The colors on `$Host.PrivateData` should affect the output

Actual behavior

Changes to `$Host.PrivateData` don't do anything anymore

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

This is what I expected: image

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
Jaykulcommented, Jul 31, 2022

So, bottom line: you added a new, non-host way of injecting virtual terminal escape sequences for the same purposes that already existed in the host, and then changed the default host so that if it thinks it’s running in a terminal that supports escape sequences … it just ignores it’s own settings.

Is that right? Is backward compatibility just out the window forever?

1reaction
SteveL-MSFTcommented, Jul 30, 2022

@Jaykul that is also an option. The only problem is if then the user updates $PSStyle, it would not be possible to reflect that back into PrivateData unless they happen to use one of the 8 colors only. It might just be something that gets documented and could be ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing PowerShell 7.2.2 color scheme to the default ...
1 Answer 1 ... by entering commands $host.PrivateData.[element name] = "[color code/name]" , $PSStyle.[element name] = "[color code/name]" and Set ...
Read more >
Changing Verbose colors in PowerShell 7.2
But this isn't really changing the verbose colors, it's just forcing it to print directly to the console host as default text using...
Read more >
Differences between Windows PowerShell 5.1 and ...
A new property ErrorAccentColor is added to $Host.PrivateData to support changing the accent color of the error message. The new Get-Error ...
Read more >
Using PowerShell with $PSStyle
In this post, I show you how you can use ANSI rendering to control text decorations, such as color and font styling, in...
Read more >
Fix powershell error colors
On the colors tab, change background to black, and text to very light gray, reverse for selected text. And most important, look at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found