You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include the current location (working directory) as part of history so that predictions based on history would show commands used from that location previously. If nothing is found, then fallback to current strategy.
Example:
> cd~/repos/powershell~/repos/powershell> git re
# prediciton would be something like: git reset --hard upstream/master
> cd~/repos/somethingelse~/repos/somethingelse> git re
# prediction would be something like: git reset --hard upstream/main
# in this example, you use `main` instead of `master` branch
The location awareness for history should not be applied globally, but should only be applied to the selected commands.
For commands like git, it usually has strong association with the folder where it runs in, so history about it should be location aware.
However, there are many other commands that have less or none association with the location where it runs in, such as azure commands, postman, dumpbin, and a lot more. For those command, history entries about them should always be presented to users, regardless of which folder they were executed in previously.
So, it's probably safer not enable folder awareness in history prediction by default, but allow user's configuration on this -- a user can say I want history prediction to apply location awareness to git command only.
Supporting this will require moving to database for storing history entries. A lot of thoughts need to be put into the user experience.
Steve Lee (@SteveL-MSFT) ,
Thank you for your answer. Dongbo Wang (@daxian-dbw) referred me to some example implementation of CommandPredictor.
I think what I want to achieve, can be done via my own custom CommandPredictor,
but I see that PSSubsystemPluginModel (which from what I understand is required for CommandPredictor) is experimental.
(https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3)
Do you have any timeline/due date, to decide if this moves from status of "experimental" to removed/mainstream ?
I don't want to put some effort, and see it is removed in 7.5 (like PSNativePSPathResolution was removed in 7.3)
Or maybe I can vote for it with some examples ?
Activity
daxian-dbw commentedon Feb 6, 2023
The location awareness for history should not be applied globally, but should only be applied to the selected commands.
For commands like
git, it usually has strong association with the folder where it runs in, so history about it should be location aware.However, there are many other commands that have less or none association with the location where it runs in, such as azure commands, postman, dumpbin, and a lot more. For those command, history entries about them should always be presented to users, regardless of which folder they were executed in previously.
So, it's probably safer not enable folder awareness in history prediction by default, but allow user's configuration on this -- a user can say I want history prediction to apply location awareness to
gitcommand only.Supporting this will require moving to database for storing history entries. A lot of thoughts need to be put into the user experience.
iksi4prs commentedon Mar 24, 2023
Steve Lee (@SteveL-MSFT) Dongbo Wang (@daxian-dbw)
Regarding my Q in discussions: #3634
is it all covered in this item and in #3380 ?
10x.
SteveL-MSFT commentedon Mar 27, 2023
iksi4prs I believe the feature in this issue would resolve those two issues
iksi4prs commentedon Mar 29, 2023
Steve Lee (@SteveL-MSFT) ,
Thank you for your answer.
Dongbo Wang (@daxian-dbw) referred me to some example implementation of CommandPredictor.
I think what I want to achieve, can be done via my own custom CommandPredictor,
but I see that PSSubsystemPluginModel (which from what I understand is required for CommandPredictor) is experimental.
(https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3)
Do you have any timeline/due date, to decide if this moves from status of "experimental" to removed/mainstream ?
I don't want to put some effort, and see it is removed in 7.5 (like PSNativePSPathResolution was removed in 7.3)
Or maybe I can vote for it with some examples ?