r/PowerShell • u/1wvy9x • Mar 29 '26
PowerShell 7.6.0 no longer saves the PSReadLine history ?
Edit : specifically with the HistorySaveStyle = 'SaveAtExit' option (?)
Hi, I’d like to ask whether there is a bug with PowerShell 7.6.0 (on Windows 11) no longer saving the PSReadLine history, or has the behaviour regarding the history been changed somehow ? I noticed that my most recent commands didn’t appear in the history, and my history file in C:\Users\UserName\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt stopped being modified six days ago, exactly when I updated from PowerShell 7.5.5 to 7.6.0
I use the default PSReadLineOptions, except for :
$PSReadLineOptions = @{
BellStyle = 'Visual'
HistorySaveStyle = 'SaveAtExit'
MaximumHistoryCount = 768
}I tried deleting entries in the history file since it was already full (but it does look like it was just deleting the oldest entries to append new ones before 7.6.0), but the history still doesn’t get saved
4
u/purplemonkeymad Mar 29 '26
If you change the save style to the default 'SaveIncrementally' does the behaviour change? It could be a bug with that option specifically.
3
u/g3n3 Mar 29 '26
What version of psreadline are you on? It is a module. You could try updating it.
4
u/Federal_Ad2455 Mar 29 '26
Not sure if it doesn't save history now but I definitely lost all my history when installed 7.6.0 version. Very annoying
2
u/GarbageSensitive8653 Apr 01 '26
i test on so many situaions finally i found shat question causes by PSReadline version . i try to reverse the powershell version to 7.5.5 it does work. i update to 7.6.0 it does not work. the really point is the psreadline version. 2.4.5 does not work on windows with powershell 7.6.0 .i install psreadline 2.3.6 and force setting it to be the default plugin for powershell 7.6.0. then the problem has been solved.
1
u/radehart Mar 29 '26
Sometime about two weeks ago readline lost its shit.
1
u/The_Anker Mar 31 '26
I had a similar issue (and managed to resolve it) with Powershell's 7.6.0 update and want to clarify, if you just can't see your recent commands in the PSReadLine's history or you can't see history completely (as if PSReadLine extension is turned off)? I am asking, because I wasn't able to see history, if I type something in my terminal
4
u/[deleted] Mar 29 '26
[removed] — view removed comment