Skip to content

Fix docs to note -PromptText is now a String[] #1244

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

Merged
merged 2 commits into from
Dec 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix docs to note -PromptText is now a String[]
Fixes #1243 to update documentation after PR #1180 changed Set-PSReadLineOption -PromptText to be a String[] instead of String.

Also normalizes docs and uses escape sequence that is supported by PowerShell 5.0 (which, sadly, does not support `e or `u{}).
  • Loading branch information
heaths committed Dec 11, 2019
commit 178a0d3ef7adefe03c3dc63ef9c21a9dae267e5d
15 changes: 9 additions & 6 deletions docs/Set-PSReadLineOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Set-PSReadLineOption
[-HistorySaveStyle <HistorySaveStyle>]
[-HistoryNoDuplicates]
[-HistorySearchCaseSensitive]
[-PromptText <string>]
[-PromptText <String[]>]
[-ExtraPromptLineCount <Int32>]
[-Colors <Hashtable>]
[-AddToHistoryHandler <Func[String, Object]>]
Expand All @@ -32,7 +32,7 @@ Set-PSReadLineOption
[-DingDuration <Int32>]
[-BellStyle <BellStyle>]
[-CompletionQueryItems <Int32>]
[-WordDelimiters <string>]
[-WordDelimiters <String>]
[-AnsiEscapeTimeout <int>]
[-ViModeIndicator <ViModeStyle>]
[-ViModeChangeHandler <ScriptBlock>]
Expand Down Expand Up @@ -85,10 +85,10 @@ This example emits a cursor change VT escape in response to a vi mode change:
PS C:\> function OnViModeChange {
if ($args[0] -eq 'Command') {
# Set the cursor to a blinking block.
Write-Host -NoNewLine "`e[1 q"
Write-Host -NoNewLine "$([char]0x1b)[1 q"
} else {
# Set the cursor to a blinking line.
Write-Host -NoNewLine "`e[5 q"
Write-Host -NoNewLine "$([char]0x1b)[5 q"
}
}
PS C:\> Set-PSReadLineOption -ViModeIndicator Script -ViModeChangeHandler OnViModeChange
Expand Down Expand Up @@ -136,11 +136,14 @@ For example, if my prompt function looked like:

Then set:

Set-PSReadLineOption -PromptText "# "
Set-PSReadLineOption -PromptText "# ", "!"

This would change the "#" in your prompt to "!" when a parse error is detected. This is especially useful with
virtual terminal escape sequences to use colors in your prompt.


```yaml
Type: String
Type: String[]
Parameter Sets: (All)
Aliases:

Expand Down