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
{{ message }}
Repository navigation
Prediction Source "History" does not use all of the PSReadline history #5014
Set Set-PSReadLineOption -MaximumHistoryCount 200000
Not so sure how to arbitrarily fill the history but you need to ensure your history at (cat (get-psreadLineOption).HistorySavePath | Measure-Object).Count is over 5128
Get the first item from history cat (get-psreadLineOption).HistorySavePath -First 1
Start typing the string from Step 3 in powershell, the history predictor does not show up anything even thought the item is already in PSReadline history
Expected behavior
The step 4 above should show the item from PSReadline history
Actual behavior
The step 4 above does not show the item from PSReadline history. It seems like the last item it will be show is (Current History Count)-5127
I have another example of it failing, without having done Set-PSReadLineOption -MaximumHistoryCount
In this screenshot, on the last command, PSReadline should match on one of the 'New-Alias c cNameFetch' lines in the history file, and suggest the auto-completion; but it does not.
There are about 146,361 lines in the file, and in the example given here, that line exists as line 136,549
When typing 'New-Alias ', an auto-completion for a different line is suggested. (gc $BigHistFile).Count
146361
Are maybe both of these problems just due to this low (default) setting?
[PSReadLine seems to me to be scanning further back than 100 commands.] (Get-PSReadLineOption).CompletionQueryItems
100
Activity
mrenton999 commentedon Apr 10, 2026
I have another example of it failing, without having done Set-PSReadLineOption -MaximumHistoryCount

In this screenshot, on the last command, PSReadline should match on one of the 'New-Alias c cNameFetch' lines in the history file, and suggest the auto-completion; but it does not.
There are about 146,361 lines in the file, and in the example given here, that line exists as line 136,549
When typing 'New-Alias ', an auto-completion for a different line is suggested.
(gc $BigHistFile).Count
146361
Are maybe both of these problems just due to this low (default) setting?
[PSReadLine seems to me to be scanning further back than 100 commands.]
(Get-PSReadLineOption).CompletionQueryItems
100
mrenton999 commentedon Apr 10, 2026
Sorry; I found the Set-PSReadLine documentation, and the -CompletionQueryItems is irrelevant.