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

config options around saving history items particularly when debugging #4198

Open
kilasuit opened this issue Sep 30, 2024 · 0 comments
Open
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@kilasuit
Copy link

kilasuit commented Sep 30, 2024

Originally raised in the PowerShell/PowerShell repo in issue 24354 by @specerboatepic

Context / Rational

When stepping through a function, one usually "spams" a combination of 'v' 'n' 'c' in debug mode. Once the function ends, or the user enters 'q', debug mode ends but those collection of debug commands are saved in the history of inputted commands, making it harder to find relevant commands in the history (pressing up on the keyboard) while searching through it. These debug commands should be disposed of from the history when debug mode ends because they are no longer useful in the scope of the session.

Thoughts/Findings

This needs work in both PSReadLine and PowerShell's History.cs file hence these issues being linked together
This also opens up the potential for new control mechanisms in PSReadLine for how we handle things like sensitive entries going forward as per #4197 and as such is linked to my issue #1886

Proposed implementation in PSReadLine

  1. Provide config options to control saving history items when in debug mode - Save-Show/Save-DontShow/DontSave
  2. When config set to NotSave - do not add items into the current psreadline file implementation or any future db implementation
  3. When config set to Save-Show - add items into the current psreadline file implementation & show in the history lookup
  4. When config set to Save-NotShow - add items into the current psreadline file implementation but mark as DontShow or any future db implementation

Similarly we'd need almost same implementation in PowerShell from my understanding

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Sep 30, 2024
@kilasuit kilasuit changed the title config options aroung saving history items when debuggin config options aroung saving history items particularly when debugging Sep 30, 2024
@daxian-dbw daxian-dbw changed the title config options aroung saving history items particularly when debugging config options around saving history items particularly when debugging Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

1 participant