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

Add PromptSymbol to Theme #81

Merged
merged 2 commits into from
Oct 26, 2024
Merged

Add PromptSymbol to Theme #81

merged 2 commits into from
Oct 26, 2024

Conversation

mdgrs-mei
Copy link
Owner

Warning

This is small but a breaking change

This PR adds PromptSymbol property to Theme and moves the default prompt "> " from $option.Prompt to $option.Theme.PromptSymbol.

Previously, even if an user customizes the prompt character, the prompt is reset by nested menus like the File Manager.

$option = Get-PSRunDefaultSelectorOption
$option.Prompt = '👉 '
Set-PSRunDefaultSelectorOption $option

image

image

By separating the PromptSymbol setting, it can keep the symbol in the nested menus.

image

This kind of advanced setting becomes possible too.

$option.Theme.PromptForegroundColor = [PowerShellRun.FontColor]::White
$option.Theme.PromptBackgroundColor = [PowerShellRun.FontColor]::Magenta
$option.Theme.PromptSymbol = "$($PSStyle.Foreground.Magenta)$($PSStyle.Background.Black)$($PSStyle.Reset)"
$option.Prompt = 'Filter'

image

image

@mdgrs-mei mdgrs-mei merged commit ff39147 into main Oct 26, 2024
3 checks passed
@mdgrs-mei mdgrs-mei deleted the prompt-symbol-theme branch October 26, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant