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

How to restore the initial state of settings? #3414

Closed
ghost opened this issue Aug 22, 2022 · 2 comments
Closed

How to restore the initial state of settings? #3414

ghost opened this issue Aug 22, 2022 · 2 comments
Labels
Resolution-Answered Question is answered

Comments

@ghost
Copy link

ghost commented Aug 22, 2022

Description of the new feature/enhancement

If it is because of my ignorance, then I thank you for your help.
If there is no such function, I hope to add a reset function.
or
The corresponding configuration will be restored automatically after deleting the corresponding code. $PROFILE

Proposed technical implementation details (optional)

I set a lot of shortcut keys and colors
Now I want to reset, back to PSReadLine's initial default settings.
Checked a lot of information and currently solved the method of deleting shortcuts, but I don't know how to reset/ or delete the color settings.
##1 This is a guide to deleting shortcuts
https://docs.microsoft.com/en-us/powershell/module/psreadline/remove-psreadlinekeyhandler?view=powershell-7.2

Waiting for the answer, thanks for your help and good luck.🙂

@ghost ghost added Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Aug 22, 2022
@daxian-dbw
Copy link
Member

The user defined key bindings are all in the Custom group, so you can get all user-defined key bindings by:

$bindings = Get-PSReadLineKeyHandler | ? Group -eq Custom

Then, you can remove them by looping through the results and call Remove-PSReadLineKeyHandler on each binding:

foreach ($i in $bindings) { Remove-PSReadLineKeyHandler -Chord $i.Key }

@daxian-dbw daxian-dbw added Resolution-Answered Question is answered and removed Issue-Enhancement It's a feature request. Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Aug 29, 2022
@ghost
Copy link

ghost commented Aug 31, 2022

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Aug 31, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Question is answered
Projects
None yet
Development

No branches or pull requests

1 participant