Tuesday, May 7, 2024
HomePowershellPSReadLine 2.3.0-beta0 Launch - PowerShell Group

PSReadLine 2.3.0-beta0 Launch – PowerShell Group


We’re happy to announce the brand new preview launch of PSReadLine 2.3.0-beta0. This launch
accommodates a number of bug fixes and enhancements to the ListView Predictive IntelliSense.

Putting in PSReadLine 2.3.0-beta0

The discharge is obtainable from the PowerShell Gallery.

Use the next command to put in PSReadLine utilizing PowerShellGet v2.x:

Set up-Module -Identify PSReadLine -AllowPrerelease -Pressure

In case you are utilizing PowerShellGet v3, you should use the next command:

Set up-PSResource -Identify PSReadLine -AllowPrerelease -Pressure

It’s essential to embody the Pressure parameter to put in this model facet by facet with the default
secure model.

Notice


It’s essential to restart your PowerShell session to make use of the brand new model of
PSReadLine.

An enormous function of this prerelease is the scrollable record view. Beforehand, the ListView mode is
restricted to indicate as much as simply 10 outcomes. With this launch, PSReadLine can present as much as 50
outcomes. The view reveals the primary 10 outcomes, however now you should use the UpArrow and
DownArrow keys to scroll the record past the primary 10 outcomes.

When you’ve gotten a number of suppliers loaded the ordering of predictors remains to be primarily based on the order that
you imported the PowerShell modules. The earlier screenshot reveals that the
Az.Instruments.Predictor module was imported earlier than the CompletionPredictor.

If the suppliers return greater than 50 outcomes mixed, the prediction outcomes are distributed as
evenly as attainable primarily based on the quantity every supplier returned.

New key bindings

Scrolling one line at a time could be gradual for giant lists. For a sooner scrolling, we added new key
bindings to assist navigate the ListView.

Key Binding Description Perform
PageUp Transfer up a web page ScrollDisplayUp
PageDown Transfer down a web page ScrollDisplayDown
Ctrl+PageUp Transfer as much as subsequent predictor’s first consequence ScrollDisplayUpLine
Ctrl+PageDown Transfer right down to the following predictor’s first consequence ScrollDisplayDownLine

These key bindings solely apply in ListView. If ListView isn’t enabled, these key bindings do what
they usually do. As with all key binding, you possibly can reconfigure the binding for these features utilizing
Set-PSReadLineKeyHandler.

Notice


These features are sure by default in Home windows and Emacs
EditModes however not in VI Mode.

Autoadjusting measurement

Since we now have the power to scroll by totally different outcomes, we are able to modify the peak of the
ListView outcomes with the shell’s window peak. The utmost measurement is 10 strains, however it shrinks to five
strains if the Console.BufferHeight is lower than or equal 20 and to three strains when the peak is much less
than or equal to 10. If the terminal width or peak is just too small, ListView shows a warning
message that the dimensions is just too small.

Animated screenshot showing ListView adjusting its size when the terminal window changes.

That is notably useful when utilizing Azure Cloud Shell, as a result of the default terminal peak is
too small to indicate 10 outcomes.

Metadata line

We’ve additionally included a brand new metadata line that present the road variety of your choice the variety of
outcomes out there from every prediction supply. The metadata line adjustments as you’re scroll by
the record.

Screenshot highlighting the metadata line descriptions.

Extra options

Deduplication of prediction outcomes

As increasingly predictors are created, we’ve observed a couple of circumstances the place the identical prediction can
come from a number of sources. To cut back the repetition of predictions, we’ve made a repair to take away
outcomes returned by the historical past predictor. Which means if historical past has a prediction that one other
predictor has, the result’s solely displayed from the historical past. This enables for extra and totally different
outcomes to be displayed and reduces confusion between two predictions with the identical actual syntax.

Change default coloration for inline prediction

We made a minor change to the inline prediction coloration to make it extra simply readable on terminals
that don’t use a pure black background, such because the VS Code terminal. The earlier setting of
darkish black has been modified to dim white italic.

Screenshot showing the new inline predictor color.

Bug fixes and new options

This launch contains the bug fixes and group contributions detailed beneath. We actually recognize
and worth group contributions!

  • Deal with multi-line description for parameter assist content material (#3358)
  • Replace module model in bot messages (#3361)
  • Add assist for upcasing, downcasing, and capitalizing phrase (#3365) (Thanks @3N4N!)
  • Repair parameter dynamic assist when the assistance content material is laid out in ParameterAttribute (#3370)
  • No record view prediction when the primary line was scrolled up off the buffer (#3372)
  • Repair unsuitable cursor place in menu completion (#3373)
  • Repair ViModeIndicator = Cursor for Home windows Terminal (#3374)
  • Repair the outline of CapitalizeWord (#3384)
  • Place ViDGChord in the precise group (#3422)
  • Replace the samples in README.md (#3440, #3424)
  • Repair some typos on this repository (#3547) (Thanks @spaette!)
  • Repair to make use of the default member coloration for members (#3450)
  • Make tab completion present outcomes whose ListItemText are totally different by case solely (#3456)
    (Thanks @dkaszews!)
  • Repair the menu completion to higher deal with the backspace key (#3574)
  • Updating Cloth bot (#3540, #3576)
  • Use ‘Visible Studio 2022’ because the picture for appveyor CI (#3594)

Suggestions

As ordinary, we welcome suggestions about this launch! Since it is a beta launch, designs and options
are topic to vary. You may submit bugs, function requests, or inquiries to the
PSReadLine repository. Your suggestions is drastically appreciated!

Steven Bucher,

PowerShell Group

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments