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
v1.0.0.11 -- PowerShell history is not populated #120
Automatically saved history is a must have feature. Thank you very much!
But it looks like PSReadline populates its internal history only. Is it by
design or is it just work in progress? I would expect PowerShell history to be
populated as well, so that PowerShell history commands work and related user
defined tools for history work, too.
Off topic
To install, you'll need WMF5, but it will work fine with V3/4. I'm just restricting who installs to the most motivated folks until I get some more testing.
Alternatively, you can build it yourself, all the code has been pushed.
I am motivated :) but I do not have WMF5 and I cannot build myself, currently. It was slightly difficult to get this release for testing...
Not populating PowerShell history is sort of by design, part laziness. I definitely considered it.
The main issue is not knowing the EndExcutionTime and ExecutionStatus when saving writing the entry incrementally - I don't want to wait until the command finishes - it might never finish, the session might get killed or whatever.
Another slight factor was wanting trivially simple parsing code. I didn't think xml or json would work easily with incremental writing and reading - I don't want to read the whole file in another session when just one command was added - a structured format pretty much would require reading the whole file.
I'll definitely keep this in mind though, but I was really wanting history shared across sessions so I implemented that first.
Ah, true, EndExcutionTime and ExecutionStatus is an issue for incremental approach. Then I would write any values there. One has to understand that this is inevitable with incremental history shared across sessions. Personally, I never use these times and statuses (I know, some people do) but I do want to see what is in the history, quite often.
I'll definitely keep this in mind though, but I was really wanting history shared across sessions so I implemented that first.
What we have right now is already very useful. Thank you once again.
I received some feedback that the option to disable incremental sharing isn't too discoverable. One suggestion is to remove HistorySaveStyle and instead have an option:
HistoryMode = NotPersistent | Persistent | Shared
The current default would map to "Persistent,Shared".
Actually, I see more interest around the convergence between the PSReadLine history and PowerShell built-in history cache.
There are more discussion about this in #1247, so close this one as a duplicate of #1247.
Activity
lzybkr commentedon Jun 14, 2014
Not populating PowerShell history is sort of by design, part laziness. I definitely considered it.
The main issue is not knowing the EndExcutionTime and ExecutionStatus when saving writing the entry incrementally - I don't want to wait until the command finishes - it might never finish, the session might get killed or whatever.
Another slight factor was wanting trivially simple parsing code. I didn't think xml or json would work easily with incremental writing and reading - I don't want to read the whole file in another session when just one command was added - a structured format pretty much would require reading the whole file.
I'll definitely keep this in mind though, but I was really wanting history shared across sessions so I implemented that first.
nightroman commentedon Jun 14, 2014
Ah, true, EndExcutionTime and ExecutionStatus is an issue for incremental approach. Then I would write any values there. One has to understand that this is inevitable with incremental history shared across sessions. Personally, I never use these times and statuses (I know, some people do) but I do want to see what is in the history, quite often.
What we have right now is already very useful. Thank you once again.
lzybkr commentedon Sep 15, 2014
I received some feedback that the option to disable incremental sharing isn't too discoverable. One suggestion is to remove HistorySaveStyle and instead have an option:
The current default would map to "Persistent,Shared".
daxian-dbw commentedon Dec 12, 2019
Actually, I see more interest around the convergence between the PSReadLine history and PowerShell built-in history cache.
There are more discussion about this in #1247, so close this one as a duplicate of #1247.