Skip to content

Support deleting items from history #22

@tig

Description

@tig
  • Ctrl-F7 - Delete items from Command History
  • Alt-F7 - Delete items from Global (PSReadline) Command History (replaces pre-defined PSReadLine Alt-F7 - ClearHistory handler)

When invoked this way, OCGV would

  • -OutputMode Multiple
  • have a Title of Delete items...Command History
  • Show the command Id as another column.

The F7History script would then do either of these, as appropriate:

  • Delete the selected items with Clear-History -Id
    • In this case, specific items can be deleted.
  • Delete the selected items from $($host.Name)_history.txt
    • In this case, all items in the file that match the selected items will be deleted.

It might be nice for the script to restart ocgv after. The user can then hit ESC to return to command line. Or not.

PSReadLine maintains a history file containing all the commands and data you've entered from the command line. The history files are a file named $($host.Name)_history.txt. On Windows systems the history file is stored at $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine. On non-Windows systems, the history files are stored at $env:XDG_DATA_HOME/powershell/PSReadLine or $env:HOME/.local/share/powershell/PSReadLine.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions