Terminal shouldn't treat read-only settings as an error reading settings #10761

Closed
opened 2026-01-31 02:29:35 +00:00 by claunia · 11 comments
Owner

Originally created by @allykzam on GitHub (Sep 24, 2020).

Environment

Windows build number: Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): 1.3.2651.0

Any other software?

Steps to reproduce

  • Change settings.json to be read-only
  • Install a new WSL flavor
  • Launch Terminal

Expected behavior

Terminal launches normally, and honors the current contents of the settings file. The new WSL flavor does not show up in the new tab options, since it is not present in the settings.

Actual behavior

Terminal launches and displays the following error message:

Failed to load setttings

Settings could not be loaded from file. Check for syntax errors, including trailing commas.

Temporarily using the Windows Terminal default settings.

My assumption here is that Terminal is encountering an exception trying to "fix" my settings file for me on launch, and just bubbles up this generic error dialog. This can be worked around by just not marking the settings file as read-only, or specifying the disabledProfileSources option with at least Windows.Terminal.Wsl in it, but I'm reporting this because it seems a bit heavy-handed to tell me my settings are completely unusable just because Terminal can't replace my settings.

Originally created by @allykzam on GitHub (Sep 24, 2020). # Environment ```none Windows build number: Win32NT 10.0.19041.0 Microsoft Windows NT 10.0.19041.0 Windows Terminal version (if applicable): 1.3.2651.0 Any other software? ``` # Steps to reproduce * Change `settings.json` to be read-only * Install a new WSL flavor * Launch Terminal # Expected behavior Terminal launches normally, and honors the current contents of the settings file. The new WSL flavor does not show up in the new tab options, since it is not present in the settings. # Actual behavior Terminal launches and displays the following error message: ``` Failed to load setttings Settings could not be loaded from file. Check for syntax errors, including trailing commas. Temporarily using the Windows Terminal default settings. ``` My assumption here is that Terminal is encountering an exception trying to "fix" my settings file for me on launch, and just bubbles up this generic error dialog. This can be worked around by just not marking the settings file as read-only, or specifying the `disabledProfileSources` option with at least `Windows.Terminal.Wsl` in it, but I'm reporting this because it seems a bit heavy-handed to tell me my settings are completely unusable just because Terminal can't replace my settings.
Author
Owner

@steveroot commented on GitHub (Sep 24, 2020):

Windows Terminal
Version: 1.3.2651.0

Same error, different message. I'm guessing the app was just updated and whilst it used to read "10" as a number it now wants 10 (no speech marks). Changing
"fontSize" : "10",
to
"fontSize" : 10,
stopped the error message
Screenshot 2020-09-24 193325 windows terminal settings load

@steveroot commented on GitHub (Sep 24, 2020): Windows Terminal Version: 1.3.2651.0 Same error, different message. I'm guessing the app was just updated and whilst it used to read "10" as a number it now wants 10 (no speech marks). Changing ` "fontSize" : "10",` to ` "fontSize" : 10,` stopped the error message ![Screenshot 2020-09-24 193325 windows terminal settings load](https://user-images.githubusercontent.com/219903/94185544-52c23000-fe9d-11ea-9930-58e1e24e3358.jpg)
Author
Owner

@DHowett commented on GitHub (Sep 24, 2020):

"same error, different message" is a different error.

You have entered a string in a field that requires a number.

@DHowett commented on GitHub (Sep 24, 2020): "same error, different message" is a different error. You have entered a string in a field that requires a number.
Author
Owner

@DHowett commented on GitHub (Sep 24, 2020):

@amazingant if I'm reading between the lines, what you'd rather have is "stop putting in profiles I don't care about". That we consider a read-only file an error is almost entirely accidental, and we definitely shouldn't hork it when that happens.

I'd rather solve your actual issue than the one you've made for yourself, however. 😄

@DHowett commented on GitHub (Sep 24, 2020): @amazingant if I'm reading between the lines, what you'd rather have is "stop putting in profiles I don't care about". That we consider a read-only file an error is almost entirely accidental, and we definitely shouldn't hork it when that happens. I'd rather solve your actual issue than the one you've made for yourself, however. :smile:
Author
Owner

@allykzam commented on GitHub (Sep 24, 2020):

@DHowett I actually am after the blowing up when my settings file is read-only - I prefer to hand-edit the settings file and keep it updated/committed in my dotfiles repo 😆

Since there's a setting to specifically stop adding other profiles (yay!), I'll definitely make use of it going forward. 😄 I subscribed myself to this repo's releases so I know when there's new settings, and usually undo the read-only and fiddle with the new settings after I get updated; it's fun seeing the progress y'all are making and getting to try the new features.

@allykzam commented on GitHub (Sep 24, 2020): @DHowett I actually am after the blowing up when my settings file is read-only - I prefer to hand-edit the settings file and keep it updated/committed in my dotfiles repo 😆 Since there's a setting to specifically stop adding other profiles (yay!), I'll definitely make use of it going forward. 😄 I subscribed myself to this repo's releases so I know when there's new settings, and _usually_ undo the read-only and fiddle with the new settings after I get updated; it's fun seeing the progress y'all are making and getting to try the new features.
Author
Owner

@steveroot commented on GitHub (Sep 25, 2020):

"same error, different message" is a different error.

You have entered a string in a field that requires a number.

Thanks & understood. @DHowett would you like a new bug report or are we happy the change to reject past working settings.json is intentional?
(and I really don't mind, my settings.json hadn't been changed for months so the error was unexpected. The error message also told me exactly what to fix so unless ignoring the whole settings.json could have unforeseen consequences for others I'm happy to leave it here.)

@steveroot commented on GitHub (Sep 25, 2020): > "same error, different message" is a different error. > > You have entered a string in a field that requires a number. Thanks & understood. @DHowett would you like a new bug report or are we happy the change to reject past working settings.json is intentional? (and I really don't mind, my settings.json hadn't been changed for months so the error was unexpected. The error message also told me exactly what to fix so unless ignoring the whole settings.json could have unforeseen consequences for others I'm happy to leave it here.)
Author
Owner

@DHowett commented on GitHub (Sep 25, 2020):

@steveroot This one's.. complicated. We chose to move to uniform JSON parsing to make our lives easier in preparation for #1564... but that came at the cost of a couple incidental compatibility tricks we were playing.

Having been the person to make that decision, I chose to allow for some small amount of scream testing. If enough people reported trouble with a particular setting, we'll go backsies on it. . . but until there's a big enough mess of complaints the strictness is "by design".

Make sense? 😄

@DHowett commented on GitHub (Sep 25, 2020): @steveroot This one's.. complicated. We chose to move to uniform JSON parsing to make our lives easier in preparation for #1564... but that came at the cost of a couple incidental compatibility tricks we were playing. Having been the person to make that decision, I chose to allow for some small amount of scream testing. If enough people reported trouble with a particular setting, we'll go backsies on it. . . but until there's a big enough mess of complaints the strictness is "by design". Make sense? :smile:
Author
Owner

@steveroot commented on GitHub (Sep 26, 2020):

Good choice, it makes sense and I agree. The error I saw (+the useful error explanation with how to fix it) is small price to pay for progress.

@steveroot commented on GitHub (Sep 26, 2020): Good choice, it makes sense and I agree. The error I saw (+the useful error explanation with how to fix it) is small price to pay for progress.
Author
Owner

@mpela81 commented on GitHub (Oct 15, 2020):

How would you expect this to work?
One option could be:

  • Do not throw exceptions when you can't write the settings file (e.g. remove exceptions from CascadiaSettings::_WriteSettings, just return a success flag)
  • If you could not write it, show a warning message
  • Settings are still updated in memory and applied (including new generated profiles, etc.), just not saved on disk.
  • As they were not saved, settings will be updated again at the next start (raising a warning again if the issue persists)
@mpela81 commented on GitHub (Oct 15, 2020): How would you expect this to work? One option could be: - Do not throw exceptions when you can't write the settings file (e.g. remove exceptions from `CascadiaSettings::_WriteSettings`, just return a success flag) - If you could not write it, show a warning message - Settings are still updated in memory and applied (including new generated profiles, etc.), just not saved on disk. - As they were not saved, settings will be updated again at the next start (raising a warning again if the issue persists)
Author
Owner

@allykzam commented on GitHub (Oct 15, 2020):

As an end user, I'd prefer that Terminal not complain at all, and have it still honor my settings as are were on disk. As a developer, if Terminal successfully reads the settings file and deserializes/validates them, but can't write an updated version of them, I'd probably want it to still honor the settings as they are on disk, but to show the user (still me) a warning.

While I've done this on purpose on my system, if someone else had done this by accident, or there were other permissions/disk issues they had run into, it would be more useful to say there was an issue writing the settings file rather than saying they made syntax errors.

@allykzam commented on GitHub (Oct 15, 2020): As an end user, I'd prefer that Terminal not complain at all, and have it still honor my settings as are were on disk. As a developer, if Terminal successfully reads the settings file and deserializes/validates them, but can't write an updated version of them, I'd probably want it to still honor the settings as they are on disk, but to show the user (still me) a warning. While I've done this on purpose on my system, if someone else had done this by accident, or there were other permissions/disk issues they had run into, it would be more useful to say there was an issue writing the settings file rather than saying they made syntax errors.
Author
Owner

@ghost commented on GitHub (Nov 11, 2020):

:tada:This issue was addressed in #7950, which has now been successfully released as Windows Terminal v1.4.3141.0.🎉

Handy links:

@ghost commented on GitHub (Nov 11, 2020): :tada:This issue was addressed in #7950, which has now been successfully released as `Windows Terminal v1.4.3141.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.4.3141.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Nov 11, 2020):

:tada:This issue was addressed in #7950, which has now been successfully released as Windows Terminal Preview v1.5.3142.0.🎉

Handy links:

@ghost commented on GitHub (Nov 11, 2020): :tada:This issue was addressed in #7950, which has now been successfully released as `Windows Terminal Preview v1.5.3142.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.5.3142.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10761