Skip to content

Commit 8849da7

Browse files
jftkcssdwheeler
andauthored
Align InvokePrompt description with new behavior (#12157) (#12158)
* Update InvokePrompt behavior (#12157) * Fix line lengths * Minor edits --------- Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
1 parent cbf6359 commit 8849da7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

reference/5.1/PSReadLine/About/about_PSReadLine_Functions.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >
33
This article documents the functions provided by PSReadLine. These functions
44
can be bound to keystrokes for easy access and invocation.
55
Locale: en-US
6-
ms.date: 10/10/2023
6+
ms.date: 06/17/2025
77
online version: https://learn.microsoft.com/powershell/module/psreadline/about/about_psreadline_functions?view=powershell-5.1&WT.mc_id=ps-gethelp
88
schema: 2.0.0
99
title: about_PSReadLine_Functions
@@ -980,18 +980,20 @@ pressing the `#` key sends 10 `#` characters (`##########`) to the input line.
980980
Similarly, you can use this with other operations, like `<Delete>` or
981981
`Left-Arrow`.
982982

983-
- Windows mode: `<Alt+0>`, `<Alt+1>`, `<Alt+2>`, `<Alt+3>`, `<Alt+4>`, `<Alt+5>`,
984-
`<Alt+6>`, `<Alt+7>`, `<Alt+8>`, `<Alt+9>`, `<Alt+->`
983+
- Windows mode: `<Alt+0>`, `<Alt+1>`, `<Alt+2>`, `<Alt+3>`, `<Alt+4>`,
984+
`<Alt+5>`, `<Alt+6>`, `<Alt+7>`, `<Alt+8>`, `<Alt+9>`, `<Alt+->`
985985
- Emacs mode: `<Alt+0>`, `<Alt+1>`, `<Alt+2>`, `<Alt+3>`, `<Alt+4>`, `<Alt+5>`,
986986
`<Alt+6>`, `<Alt+7>`, `<Alt+8>`, `<Alt+9>`, `<Alt+->`
987987
- Vi command mode: `<0>`, `<1>`, `<2>`, `<3>`, `<4>`, `<5>`, `<6>`, `<7>`,
988988
`<8>`, `<9>`
989989

990990
### InvokePrompt
991991

992-
Erases the current prompt and calls the prompt function to redisplay the
993-
prompt. Useful for custom key handlers that change state. For example, change
994-
the current directory.
992+
Attempts to erase the current prompt and call the prompt function to redisplay
993+
the prompt. Useful for custom key handlers that change state. For example,
994+
change the current directory. This method can't overwrite a prompt that has
995+
left the screen buffer. Calls to `InvokePrompt` with no `Y` position argument
996+
return immediately if the prompt can't be overwritten.
995997

996998
- Function is unbound.
997999

0 commit comments

Comments
 (0)