Skip to content

Commit 7984b6e

Browse files
heathsdaxian-dbw
authored andcommitted
Fix docs to note -PromptText is now a String[] (#1244)
1 parent bca45bb commit 7984b6e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/Set-PSReadLineOption.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Set-PSReadLineOption
1818
[-HistorySaveStyle <HistorySaveStyle>]
1919
[-HistoryNoDuplicates]
2020
[-HistorySearchCaseSensitive]
21-
[-PromptText <string>]
21+
[-PromptText <String[]>]
2222
[-ExtraPromptLineCount <Int32>]
2323
[-Colors <Hashtable>]
2424
[-AddToHistoryHandler <Func[String, Object]>]
@@ -32,7 +32,7 @@ Set-PSReadLineOption
3232
[-DingDuration <Int32>]
3333
[-BellStyle <BellStyle>]
3434
[-CompletionQueryItems <Int32>]
35-
[-WordDelimiters <string>]
35+
[-WordDelimiters <String>]
3636
[-AnsiEscapeTimeout <int>]
3737
[-ViModeIndicator <ViModeStyle>]
3838
[-ViModeChangeHandler <ScriptBlock>]
@@ -85,10 +85,10 @@ This example emits a cursor change VT escape in response to a vi mode change:
8585
PS C:\> function OnViModeChange {
8686
if ($args[0] -eq 'Command') {
8787
# Set the cursor to a blinking block.
88-
Write-Host -NoNewLine "`e[1 q"
88+
Write-Host -NoNewLine "$([char]0x1b)[1 q"
8989
} else {
9090
# Set the cursor to a blinking line.
91-
Write-Host -NoNewLine "`e[5 q"
91+
Write-Host -NoNewLine "$([char]0x1b)[5 q"
9292
}
9393
}
9494
PS C:\> Set-PSReadLineOption -ViModeIndicator Script -ViModeChangeHandler OnViModeChange
@@ -136,11 +136,14 @@ For example, if my prompt function looked like:
136136
137137
Then set:
138138
139-
Set-PSReadLineOption -PromptText "# "
139+
Set-PSReadLineOption -PromptText "# ", "! "
140+
141+
This would change the "#" in your prompt to "!" when a parse error is detected. This is especially useful with
142+
virtual terminal escape sequences to use colors in your prompt.
140143
141144
142145
```yaml
143-
Type: String
146+
Type: String[]
144147
Parameter Sets: (All)
145148
Aliases:
146149

0 commit comments

Comments
 (0)