Open fullenw1 opened 1 year ago
The difficulty with this is I want to search for commands where I have done things with *.tmp or whatever, so how does one differentiate between searching for a wildcard, and searching with a wildcard.
If you have predictive history on you can toggle between "Suggest closest" and "Show me options" with F2. So for that example if I know the command is in the history but isn't the most recent I'll start with get-adu and then press F2 and pick the right one. Not perfect, especially if muscle memory is hard coded to # whatever
or [ctrl]+[r] whatever, but another tool if it suits.
The difficulty with this is I want to search for commands where I have done things with *.tmp or whatever, so how does one differentiate between searching for a wildcard, and searching with a wildcard.
If you have predictive history on you can toggle between "Suggest closest" and "Show me options" with F2. So for that example if I know the command is in the history but isn't the most recent I'll start with get-adu and then press F2 and pick the right one. Not perfect, especially if muscle memory is hard coded to
# whatever
or [ctrl]+[r] whatever, but another tool if it suits.
Yes, being able to use wildcards with predictive history would be great too! 😃
There is already somebody developing something similar but currently only limited to the filesystem. https://github.com/Ink230/DirectoryPredictor Maybe you should have a look...
GitHubPowerShell Module which displays related files, actively from the current directory, in your PSReadLine autocompletion list. - GitHub - Ink230/DirectoryPredictor: PowerShell Module which displays r...
I think this issue should be moved across to the PSReadline repo - @SteveL-MSFT / @daxian-dbw can you do this for me?
Also this perhaps would be something that could be better achieved whenever this issue gets implemented
@fullenw1 Just so I'm clear, are you asking for wildcard matching in history prediction, or the history searching, like when using Ctrl+r?
@fullenw1 Just so I'm clear, are you asking for wildcard matching in history prediction, or the history searching, like when using Ctrl+r?
@daxian-dbw , originally it was for the history searching, like when using CTRL + R
.
However, one can assume that if wildcards can be used with the history prediction too, then the history searching would become nearly useless, except for those who don't want/like to use the history prediction.
Currently, I still use both.
But I noticed that with the improvement of the history prediction (thanks to the CompletionPredictor
module), I use less the history searching.
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:
Currently I have to go through:
Request:
I wish I could make my search with:
Proposed technical implementation details (optional)
A similar feature already exists, though currently limited to the file system.
https://github.com/Ink230/DirectoryPredictor