PSReadLine history search with wildcards

Open
#3,681 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell
Domain
cli

Research direction

Start by tracing PSReadLine's forward and backward history-search entry points; the issue does not name specific files or tests. Compare the requested Get-ADUser*accountX behavior with the linked DirectoryPredictor example. Done means history search accepts wildcard-style queries and returns the intended matching command without requiring repeated navigation.

Written by the indexing model from the issue text.

Description

Area-HistoryImprovements Issue-Enhancement
Summary of the new feature / enhancement

Often I remember some elements of former command lines.
However when I used the forward/backward search capability,
I have usually to go trough a lot of suggestions before finding the match.
Being able to use wild cards would dramatically improve the research experience.

Exemple of current behavior:

I need to search for a line with:

Get-ADUser -Property Description, Manager -Identity accountX

Currently I have to go through:

Get-ADUser -Identity accountA
Get-ADUser -Property Description -Identity accountC
Get-ADUser -Property Manager -Identity accountD
Get-ADUser -Property Description, Manager -Identity accountN
Get-ADUser -Property Description, Manager -Identity accountO
Get-ADUser -Property Description, Manager -Identity accountX
Request:

I wish I could make my search with:

Get-ADUser*accountX
Proposed technical implementation details (optional)

A similar feature already exists, though currently limited to the file system.

https://github.com/Ink230/DirectoryPredictor

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.