Describe "Functionality"
Console colors can be reconfigured arbitrarily, causing our set colors for Show-MeditationPrompt to become a bit unreadable. We could handle this better.
Context "Private or Public? What are the use cases? Parameters? Options?"
Private module handler command, possibly tied in with Write-ConsoleLine
Context "Additional Information"
from @SeeminglyScience's reply:
@vexx32 If PSReadLine is loaded you can pull from it's settings to determine what colors to use.
$psrlModule = Get-Module PSReadLine
if (-not $psrlModule) {
return
}
$options = Get-PSReadLineOption
if ($psrlModule.Version.Major -ge 2) {
# Handle as ANSI escape
return '{1}Colored like a number{0} {2}Colored like a keyword{0}' -f (
"$([char]27)[0m", # Reset color ANSI escape
$options.NumberColor,
$options.KeywordColor)
} else {
# Handle like ConsoleColor
}
/cc @thomasrayner @SeeminglyScience
Describe "Functionality"
Console colors can be reconfigured arbitrarily, causing our set colors for
Show-MeditationPromptto become a bit unreadable. We could handle this better.Context "Private or Public? What are the use cases? Parameters? Options?"
Private module handler command, possibly tied in with
Write-ConsoleLineContext "Additional Information"
from @SeeminglyScience's reply:
/cc @thomasrayner @SeeminglyScience