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

Make prompt colors configurable #10339

Open
2 tasks done
dkaszews opened this issue Aug 16, 2023 · 0 comments
Open
2 tasks done

Make prompt colors configurable #10339

dkaszews opened this issue Aug 16, 2023 · 0 comments
Labels
area-about Area - About_ topics hold-for-pr Waiting - for PR merge hold-for-release Waiting - for next release issue-doc-idea Issue - request for new content
Milestone

Comments

@dkaszews
Copy link

dkaszews commented Aug 16, 2023

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

PowerShell/PowerShell#18003 introduces new properties to $PSStyle that control how -Confirm prompt is rendered:

$PSStyle.Prompt.Caption
$PSStyle.Prompt.Message
$PSStyle.Prompt.Help
$PSStyle.Prompt.ChoiceDefault
$PSStyle.Prompt.ChoiceOther
$PSStyle.Prompt.ChoiceHelp

Details

The documentation should explain which property controls which part of the confirm prompt. In the example below:

$PSStyle.Prompt.Caption = $PSStyle.Background.Red  # First line
$PSStyle.Prompt.Message = $PSStyle.Foreground.BrightBlack  # Other lines
$PSStyle.Prompt.Help = $PSStyle.Foreground.Purple  # "default is"
$PSStyle.Prompt.ChoiceDefault = $PSStyle.Foreground.Purple  # First choice
$PSStyle.Prompt.ChoiceOther = $PSStyle.Foreground.Blue  # Other choices
$PSStyle.Prompt.ChoiceHelp = $PSStyle.Foreground.Green  # Choice "[?] Help"

image

An image with rectangles and arrows deliminating each section may be clearer than trying to match colors.

Articles

  • reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md, section -Confirm

Related Source Pull Requests

Related Source Issues

@dkaszews dkaszews added issue-doc-idea Issue - request for new content needs-triage Waiting - Needs triage labels Aug 16, 2023
@sdwheeler sdwheeler added hold-for-pr Waiting - for PR merge area-about Area - About_ topics hold-for-release Waiting - for next release and removed needs-triage Waiting - Needs triage labels Aug 17, 2023
@sdwheeler sdwheeler added this to the Future milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-about Area - About_ topics hold-for-pr Waiting - for PR merge hold-for-release Waiting - for next release issue-doc-idea Issue - request for new content
Projects
None yet
Development

No branches or pull requests

2 participants