Skip to content

PSReadline does not suggest old history #4131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
mdanish-kh opened this issue Aug 21, 2024 · 2 comments
Closed
3 tasks done

PSReadline does not suggest old history #4131

mdanish-kh opened this issue Aug 21, 2024 · 2 comments
Labels
Resolution-Answered Question is answered

Comments

@mdanish-kh
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

Screenshot 1
image

Screenshot 2
image

Environment data

PS Version: 7.4.4
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.4.0-beta0
PSReadLine EditMode: Windows
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 156
BufferHeight: 40

Steps to reproduce

I have a an entry in my history file for python manage.py startapp (see screenshot 2). The current size of history file is 484 KB with ~10,000 lines. This most recent entry for this line is present at 5006 line number. I am not aware how far up the history query goes, judging by this comment I suppose it's the last 1 MB. If that's so, I would expect that PSReadline would suggest me this entry.

Expected behavior

PSReadline doesn't suggest me the line entry (see screenshot 1 above)

Actual behavior

PSReadline should suggest me the line entry

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Aug 21, 2024
@daxian-dbw
Copy link
Member

The maximum history entries read from the history file is controlled by Set-PSReadLineOption -MaximumHistoryCount. By default, MaximumHistoryCount is 4096, same as the automatic variable $MaximumHistoryCount of the PowerShell session.
In your case, please set it to a larger number, so that the history entry you want can be included in.

@daxian-dbw daxian-dbw added Resolution-Answered Question is answered and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Aug 21, 2024
@mdanish-kh
Copy link
Author

Ah, I should've poked around more to find it. I''ve put that command in my $PROFILE now. Anyways thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Question is answered
Projects
None yet
Development

No branches or pull requests

2 participants