PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

KeyHandler to toggle through predictors sources

Open StevenBucher98 opened this issue 3 years ago • 1 comments

Prerequisites

  • [X] Write a descriptive title.

Description of the new feature/enhancement

Instead of typing Set-PSReadlineOption -PredictionSource <source> the user would be able to use a key handler to toggle between all the possible options for -PredictorSource and have a display note of which predictor source a user is on.

Open for discussion on the exact UI implementation.

Proposed technical implementation details (optional)

Shift + F2 to switch between different predictor sources.

PS C:\Users\stevenbucher> <Press Shift+F2>
PSReadLineOption Predictor Source now set to History

PS C:\Users\stevenbucher> <Press Shift+F2>
PSReadLineOption Predictor Source now set to HistoryAndPlugin

PS C:\Users\stevenbucher> <Press Shift+F2>
PSReadLineOption Predictor Source now set to Plugin

PS C:\Users\stevenbucher> <Press Shift+F2>
PSReadLineOption Predictor Source now set to None

StevenBucher98 avatar Jul 16 '22 18:07 StevenBucher98

A way to add a keyhandler for toggling on and off predictors can be found here: https://ianmorozoff.com/2023/01/10/predictive-intellisense-on-by-default-in-powershell-7-3/#keybinding

StevenBucher98 avatar Mar 01 '23 21:03 StevenBucher98