Skip to content

Make history prediction location aware #3472

Open

Description

@SteveL-MSFT

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

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

Proposed technical implementation details (optional)

No response

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Nov 6, 2022
  2. added
    Area-PredictorsLabel for issues related to predictors
    and removed
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Jan 4, 2023
  3. daxian-dbw commented on Feb 6, 2023

    @daxian-dbw
    Member

    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.

  4. iksi4prs commented on Mar 24, 2023

    @iksi4prs

    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.

  5. SteveL-MSFT commented on Mar 27, 2023

    @SteveL-MSFT
    MemberAuthor

    iksi4prs I believe the feature in this issue would resolve those two issues

  6. iksi4prs commented on Mar 29, 2023

    @iksi4prs

    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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-HistoryImprovementsLabel for tracking different improvements to historyArea-PredictorsLabel for issues related to predictorsIssue-EnhancementIt's a feature request.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions