microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.39k stars 8.3k forks source link

[Settings UI] Add a button to reset the settings to defaults #947

Open justalemon opened 5 years ago

justalemon commented 5 years ago

Summary of the new feature/enhancement

Sometimes, I update between builds and see breaking changes on the configuration side. I know that this is normal on Alpha software but there should be a way to remove the configuration without having to delete profiles.json manually.

This can also be helpful for end users once the Terminal is released.

Proposed technical implementation details (optional)

This can work like the normal Shift + Right Click on the Windows Explorer: A Shift + Left Click on the selector should show more options like the already mentioned Delete/Reset Configuration.

zadjii-msft commented 5 years ago

Out of curiosity, do you know which PR introduced a breaking change for the settings? The only two I can think of would be the color names one and the keybindings one. The first left the legacy de-serialization code, so the color tables would be gracefully updated. The latter had a conditional that included checking to see if no keybindings were found, and generating the defaults in that case.

DHowett-MSFT commented 5 years ago

There should not have been any breaking changes in configuration since we released the first open-source version of Terminal. Are you referring to things like #934, #869, #742, #466 and friends that just change the defaults?

DHowett-MSFT commented 5 years ago

(accidental closure; please disregard)

justalemon commented 5 years ago

Out of curiosity, do you know which PR introduced a breaking change for the settings?

That was a misinterpreted example, I know that there have not been any breaking changes during the last days. I was thinking that in the future with the full implementation of features like icons and multiple WSL distros the configuration format and/or parameter names might change.

Plus, this feature is also useful for when the user changes the values and want to reset them to default.

zadjii-msft commented 5 years ago

I think the long-term intention here is to have a cascading settings model, where there's a static "default settings" file, and the user's settings are in a separate file, which is applied on top of the defaults. In that scenario, the "reset to defaults" flow would just be deleting everything in your user settings. This work is being tracked in #754.

Additionally, there's other work being done to add an actual settings dialog, which will allow for changing the settings without needing to edit the file directly. This seems like a great request for that UI :)

WSLUser commented 5 years ago

here's other work being done to add an actual settings dialog, which will allow for changing the settings without needing to edit the file directly

I think https://github.com/microsoft/vscode would be the best place to look to. The Settings UI there is great and having a similar one (maybe little more simplistic) for the Terminal would be great. Honestly with all the json going on in the backend with Terminal, I'm curious just how much of what VSCode has can be directly ported.

DHowett-MSFT commented 5 years ago

On account of the Terminal is not written in javascript or running in electron but that VSCode is, none of it. :smile:

WSLUser commented 5 years ago

Well I knew the bulk of the code there wouldn't be useful due to those reasons but thought the json files may be of use. I took a look at the core files in https://github.com/microsoft/vscode/blob/master/.vscode/ and have to agree they can't be used as is but they do provide a good example for anyone interested in improvements in this repo.

I did just try to look for the UI component for settings and nothing stands out immediately. If it's written in JS/TS then may not be useful though not sure if it's possible to convert to C ++ (don't really mess with the C family much, much prefer python).

mrmlnc commented 5 years ago

Just my two cents.

Version: 0.2.1715.0

Accidentally or intentionally, I can delete the contents of the settings file (profiles.json). Unfortunately, I can't get the content back without manually deleting the file.

It would be nice to add a reset button to the dialog:

Annotation 2019-06-22 165036
aaroneg commented 5 years ago

I would personally favor a menu item below "settings" and above "Feedback" to reset settings to default, especially while we're in preview releases. I'm not concerned about breaking changes, and I know how to just delete profiles.json, but the workflow is inconvenient, and removing it seems to be the only way to get Terminal to recognize a new WSL distro unless i want to built a profile for that myself, which isn't a super exciting prospect for me. It also allows Terminal to put new settings in the file like 'copyOnSelect' in the correct place so i can be lazy and just swap that from false to true without having to guess where i should place that in the file.

gulshan commented 5 years ago

Has there anything changed with the latest release? The "cascading settings" issue #754 is closed now. Can I just delete the settings file to reset to default?

zadjii-msft commented 5 years ago

Boy oh boy that comment seems like so long ago. That was written before we even had a good picture of what cascading settings would be like.

@gulshan you could always have done that and had the terminal re-generate a settings file for you. Now when it re-generates the file, it will be much simpler.

The "add a button to delete the settings" work still needs to be done.

marcelwgn commented 7 months ago

So is this up for grabs and if so, what would the ideal way be to implement this? Should a "Delete Settings file" button be placed under or next to the "Open JSON File" button?