Disparity between PSReadLine + *-History commands creates confusion
See original GitHub issueGiven that the decision has been made to require and integrate an external module PSReadLine for command handling, it’s confusing ( PowerShell/PowerShell#5711 PowerShell/PSReadLine#1074 ) and redundant to have two copies of the history, and the commands which modify history should be made to (optionally?) modify both.
Right now, the PowerShell History is numbered, and supports re-invoking via Invoke-History
(or r
) and also via tab-completion like #1{Tab}
, but PSReadLine owns the hotkeys and search!
The PSReadLine history is persistent, but only the PowerShell History has commands to import/export/clear it – which allow one to modify what’s stored in the history in the case one accidentally types something one doesn’t want logged.
Obviously there’s a substantial difference between them, architecturally – since PSReadLine’s history only contains the actual command-lines, but the actual history retrieved by Get-History includes the status, as well as the start and end time…
However, this dichotomy, combined with the use of bash-similar aliases (history
and r
etc) and hotkeys which sometimes return different (or no) results is confusing and should be resolved – ideally, by having the history commands work on (or appear to work on) the same (size) persistent history buffer as PSReadLine.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:16 (7 by maintainers)
For the record (here in the future): July ended with 3.97M startups of PowerShell Core 6. 82% of them on Linux. I think we can end the debate about whether it’s needed: clearly the vast majority of people using PS6 are on Linux and therefore need a ReadLine module.
If you don’t include PSReadLine by default on Linux and macOS, you might as well pack it up and go home. Without PSRL, PowerShell line editing is too far behind Bash for folks to take PowerShell seriously - on those platforms.
You can add
Remove-Module PSReadLine
to your profile to remove it - if that’s what you’d prefer - even on PS Core.