Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deleting items from history #22

Open
tig opened this issue Nov 7, 2023 · 0 comments
Open

Support deleting items from history #22

tig opened this issue Nov 7, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tig
Copy link
Collaborator

tig commented Nov 7, 2023

  • 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.

@tig tig added the enhancement New feature or request label Nov 7, 2023
@tig tig self-assigned this Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant