Make predictions not show invalid paths · Issue #3380 · PowerShell/PSReadLine · GitHub
Skip to content

Make predictions not show invalid paths #3380

Open

Description

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

When using the new prediction, it would be nice if incorrect paths were not presented as suggestions, at least for well-known/default cmdlets like Set-Location, Get-ChildItem and so on

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 Jul 15, 2022
  2. changed the title [-]Make predictions aware of current path[/-] [+]Make predictions not show invalid paths[/+] on Nov 6, 2022
  3. StevenBucher98 commented on Jan 4, 2023

    @StevenBucher98
    Collaborator

    Renato Golia (@Kralizek) which predictors were you using that were presenting incorrect paths? If you have an example of this behavior currently that would be helpful!

  4. Kralizek commented on Jan 4, 2023

    @Kralizek
    Author

    Steven Bucher (@StevenBucher98)

    The problem I have been experiencing can be summarized as follows:

    If i have a directory tree first\second\third

    If I do

    cd first
    

    When I'm in first, if i start typing "cd", I get "first" suggested even if it's not a valid input.

    (Sorry for the formatting, I saw the notification just when I had turned off the PC)

  5. StevenBucher98 commented on Jan 4, 2023

    @StevenBucher98
    Collaborator

    Got it thanks Renato Golia (@Kralizek) for clarification! Currently that is the expected behavior since last in your history is the cd first but we are looking at adding to history predictors in the future, related issue #3472

  6. 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
  7. Kralizek commented on Jan 4, 2023

    @Kralizek
    Author

    Steven Bucher (@StevenBucher98) I didn't know of that issue. Ideally a predictor could also try to suggest new values that are valid in any given context.

    In this case, it would be cool if second was a value considered for prediction.

  8. daxian-dbw commented on Mar 28, 2023

    @daxian-dbw
    Member

    Renato Golia (@Kralizek) I think what you want is prediction from the results of tab completion -- prediction result should be shown for cd . just like you press Tab. If my understanding is correct, then this issue should be migrated to https://github.com/PowerShell/CompletionPredictor.

    [Update] Reading through the comments again, and I guess your concern is more about the history predictions should be filtered more smartly (cd first came from the history). Then we should keep this issue in this repo.

  9. Kralizek commented on Mar 28, 2023

    @Kralizek
    Author

    Your updated comment is correct.

  10. daxian-dbw commented on Mar 28, 2023

    @daxian-dbw
    Member

    Be noted that, even if the history prediction is filtered more smartly, you won't see cd second as the prediction for the above scenario, becuase it's not yet available in the history.

  11. Kralizek commented on Mar 29, 2023

    @Kralizek
    Author

    Be noted that, even if the history prediction is filtered more smartly, you won't see cd second as the prediction for the above scenario, becuase it's not yet available in the history.

    It makes sense and fine with not having wrong suggestions :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions