PSReadLine cannot handle super large history file properly
See original GitHub issuePrerequisites
- 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
System out of memory and it consume lots of memory when i see in task manager.
Screenshot
Environment data
PS Version: 5.1.14393.5582
PS HostName: ConsoleHost
PSReadLine Version: 1.2
PSReadLine EditMode: Windows
OS: 10.0.14393.0 (rs1_release.160715-1616)
BufferWidth: 139
BufferHeight: 3000
Steps to reproduce
Start powershell in visual code or windows it always crashed
Expected behavior
always crashed
Actual behavior
Start powershell in visual code or windows it always crashed
Issue Analytics
- State:
- Created a month ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Limit size of ConsoleHost_history.txt file · Issue #537
Recently, accessing command history via the up-arrow has been quite slow (3-5 seconds to respond), and today, when I opened PowerShell, ...
Read more >Managing the PSReadline History File
When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified ...
Read more >Powershell PSReadLine History
Commands entered using PSReadLine are (typically) appended to the history file as they are entered (this behaviour can also be controlled using ...
Read more >Leverage PowerShell History across multiple machines
So, once I had PSReadLine installed on my PC I verified the location of my history file by using the Get-PSReadLineOption command.
Read more >Powershell history isn't persistent anymore
Using Import-Module PSReadLine makes the history work properly. As a workaround, I put the command into the PS profile file, so it gets...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@daxian-dbw this would be another good reason for this feature request as that would move it outside of .NET limitations
Even after moving to using sqlite for history, the file-based history saving will need to be preserved indefinitely to make it backward compatible. I’m planning to update the code to only read the last 1mb content from the history file, so this issue can be avoided.