22external help file : Microsoft.PowerShell.PSReadLine2.dll-Help.xml
33Locale : en-US
44Module Name : PSReadLine
5- ms.date : 07/19 /2023
5+ ms.date : 08/20 /2023
66online version : https://learn.microsoft.com/powershell/module/psreadline/set-psreadlineoption?view=powershell-7.4&WT.mc_id=ps-gethelp
77schema : 2.0.0
88title : Set-PSReadLineOption
@@ -25,7 +25,8 @@ Set-PSReadLineOption [-EditMode <EditMode>] [-ContinuationPrompt <String>] [-His
2525 [-HistorySearchCaseSensitive] [-HistorySaveStyle <HistorySaveStyle>] [-HistorySavePath <String>]
2626 [-AnsiEscapeTimeout <Int32>] [-PromptText <String[]>] [-ViModeIndicator <ViModeStyle>]
2727 [-ViModeChangeHandler <ScriptBlock>] [-PredictionSource <PredictionSource>]
28- [-PredictionViewStyle <PredictionViewStyle>] [-Colors <Hashtable>] [<CommonParameters>]
28+ [-PredictionViewStyle <PredictionViewStyle>] [-Colors <Hashtable>] [-TerminateOrphanedConsoleApps]
29+ [<CommonParameters>]
2930```
3031
3132## DESCRIPTION
@@ -208,8 +209,8 @@ Specifies a **ScriptBlock** that controls which commands get added to **PSReadLi
208209
209210The ** ScriptBlock** receives the command line as input.
210211
211- The ** ScripBlock** should return a member of the ** AddToHistoryOption** enum, the string name of
212- one of those members, or a boolean value. The list below describes the possible values and their
212+ The ** ScripBlock** should return a member of the ** AddToHistoryOption** enum, the string name of one
213+ of those members, or a boolean value. The list below describes the possible values and their
213214effects.
214215
215216- ` MemoryAndFile ` - Add the command to the history file and the current session.
@@ -236,8 +237,8 @@ This option is specific to Windows when input is redirected, for example, when r
236237or `screen`.
237238
238239With redirected input on Windows, many keys are sent as a sequence of characters starting with the
239- escape character. It's impossible to distinguish between a single escape character followed by
240- more characters and a valid escape sequence.
240+ escape character. It's impossible to distinguish between a single escape character followed by more
241+ characters and a valid escape sequence.
241242
242243The assumption is that the terminal can send the characters faster than a user types. **PSReadLine**
243244waits for this timeout before concluding that it has received a complete escape sequence.
@@ -283,7 +284,8 @@ Accept wildcard characters: False
283284The **Colors** parameter specifies various colors used by **PSReadLine**.
284285
285286The argument is a hash table where the keys specify which element and the values specify the color.
286- For more information, see [about_Hash_Tables](/powershell/module/microsoft.powershell.core/about/about_hash_tables).
287+ For more information, see
288+ [about_Hash_Tables](/powershell/module/microsoft.powershell.core/about/about_hash_tables).
287289
288290Colors can be either a value from **ConsoleColor**, for example `[ConsoleColor]::Red`, or a valid
289291ANSI escape sequence. Valid escape sequences depend on your terminal. In PowerShell 5.0, an example
@@ -302,7 +304,8 @@ Two color settings were added to support customization of the `ListView` in PSRe
302304- Foreground, background, or both
303305- Inverse, bold
304306
305- For more information about ANSI color codes, see [ANSI escape code](https://wikipedia.org/wiki/ANSI_escape_code#Colors_) in Wikipedia.
307+ For more information about ANSI color codes, see the Wikipedia article
308+ [ANSI escape code](https://wikipedia.org/wiki/ANSI_escape_code#Colors_).
306309
307310The valid keys include :
308311
@@ -727,10 +730,9 @@ When displaying possible completions, tooltips are shown in the list of completi
727730This option is enabled by default. This option wasn't enabled by default in prior versions of
728731**PSReadLine**. To disable, set this option to `$False`.
729732
730- By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions**
731- object is set to `True`. Using this **SwitchParameter** sets the property value to `True`. To change
732- the property value, you must specify the value of the **SwitchParameter** as follows :
733- ` -ShowToolTips:$False` .
733+ By default, the **ShowToolTips** property of the global **PSConsoleReadLineOptions** object is set
734+ to `True`. Using this **SwitchParameter** sets the property value to `True`. To change the property
735+ value, you must specify the value of the **SwitchParameter** as follows : ` -ShowToolTips:$False` .
734736
735737Using the following command, you can set the property value directly :
736738
@@ -748,6 +750,34 @@ Accept pipeline input: False
748750Accept wildcard characters: False
749751` ` `
750752
753+ # ## -TerminateOrphanedConsoleApps
754+
755+ This parameter sets the **TerminateOrphanedConsoleApps** option to `$true`.
756+
757+ On Windows, when you press <kbd>Ctrl</kbd>+<kbd>c</kbd> to terminate a process, each process
758+ attached to a console receives a terminate signal, as opposed to just the active shell. Sometimes,
759+ when a shell has launched some large tree of child processes, (imagine a build system, for example)
760+ some processes may exit, leaving multiple processes concurrently trying to consume console input.
761+
762+ When setting the **TerminateOrphanedConsoleApps** option to `$true`, PSReadLine records the list of
763+ processes that are currently attached to the console. Afterwards, whenever PSReadLine runs, it will
764+ get a new list of processes attached to the console, and terminate those that aren't in the original
765+ list.
766+
767+ This parameter and option were added in PSReadLine 2.3.2-beta2.
768+
769+ ` ` ` yaml
770+ Type: System.Management.Automation.SwitchParameter
771+ Parameter Sets: (All)
772+ Aliases:
773+
774+ Required: False
775+ Position: Named
776+ Default value: None
777+ Accept pipeline input: False
778+ Accept wildcard characters: False
779+ ` ` `
780+
751781# ## -ViModeChangeHandler
752782
753783When the **ViModeIndicator** is set to `Script`, the script block provided will be invoked every
0 commit comments