Sunday, July 14, 2024
HomePowershellPSReadLine 2.2.6 allows Predictive Intellisense by default

PSReadLine 2.2.6 allows Predictive Intellisense by default

PSReadLine first launched
Predictive IntelliSense
utilizing Historical past based mostly strategies as a buyer enabled function in November 2020. Since its
introduction, two new predictors have turn out to be out there:

As we speak, we’re saying that PSReadLine 2.2.6 allows Predictive IntelliSense by default.

Based mostly on group suggestions and profitable early releases, prospects now not have to manually
allow predictions. This launch is supported on Home windows PowerShell 5.1 and better.

Predictions are enabled by default

Beforehand, to allow predictions, prospects had been required so as to add the next to their
PowerShell profile:

Set-PSReadLineOption -PredictionSource HistoryAndPlugin

As we speak, the PredictionSource is enabled by default as HistoryAndPlugin for PowerShell 7.2
and better or Historical past downlevel to Home windows PowerShell 5.1 . Clients can confirm this setting
utilizing the next command:

Get-PSReadLineOption | Choose-Object -Property PredictionSource

Notice – Plug-ins are solely supported in PowerShell 7.2 or larger.

Putting in PSReadLine 2.2.6

The discharge is now out there for obtain on the
PowerShell Gallery.

To put in PSReadLine:

Set up-Module -Title PSReadLine

To put in PSReadLine utilizing the brand new

Set up-PSResource -Title PSReadLine

Managing Predictive IntelliSense

Some prospects might choose to disable Predictive IntelliSense. To alter the prediction supply, add
the Set-PSRedLineOption cmdlet to your profile with one of many following values:

To disable all predictions:

Set-PSReadLineOption -PredictionSource None

To solely allow history-based strategies:

Set-PSReadLineOption -PredictionSource Historical past

To solely allow extra plugins with out historical past:

Set-PSReadLineOption -PredictionSource Plugin

Setting the prediction colour

By default, predictions seem in gentle gray textual content on the identical line the consumer is typing. To assist
accessibility wants, the prediction colour is customizable from the command line or your profile

For extra details about setting prediction colour and different PSReadLine settings, see Set-PSReadLineOption

Instance of setting prediction background colour to Blue utilizing $PSStyle:

Set-PSReadLineOption -Colours @{ InlinePrediction = $ }

The default light-grey prediction textual content colour could be restored utilizing:

Set-PSReadLineOption -Colours @{ InlinePrediction = "`e[38;5;238m" }

Future plans

We value your ideas and feedback for this release. Stop by the
PSReadLine GitHub repository and let us know of
any issues you find or features you would like added.



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments