Windows Terminal may not open if profiles.json is corrupted #2031

Closed
opened 2026-01-30 22:45:00 +00:00 by claunia · 7 comments
Owner

Originally created by @Karl-WE on GitHub (Jun 24, 2019).

Environment

Windows build number: Windows 10 1903

Windows Terminal version (if applicable): 0.2.1715.0

Any other software?

Steps to reproduce

edit profiles.json e.g. I tried to copy and paste some schemas from this templated
https://gist.github.com/mehulmpt/16826be279bb9bf70310b465ca9c5de3

After saving everything was fine and I really took care about not doing a mistake in the json formatting. However after closing and reopening Windows terminal

copy line 63 to 131 at the appropriate spot in profiles.json
https://gist.github.com/fcharlie/7530d36175bc5249f1ae92be536238cd

Expected behavior

The file should be checked for errors on startup of Windows Terminal. If there is an error it should fallback to a default config
also see #1404

Actual behavior

Windows Terminal does not start. no error message.

workaround

fully reset the app in app and features

Originally created by @Karl-WE on GitHub (Jun 24, 2019). <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment Windows build number: Windows 10 1903 Windows Terminal version (if applicable): 0.2.1715.0 Any other software? # Steps to reproduce edit profiles.json e.g. I tried to copy and paste some schemas from this templated https://gist.github.com/mehulmpt/16826be279bb9bf70310b465ca9c5de3 After saving everything was fine and I really took care about not doing a mistake in the json formatting. However after closing and reopening Windows terminal <!-- A description of how to trigger this bug. --> copy line 63 to 131 at the appropriate spot in profiles.json https://gist.github.com/fcharlie/7530d36175bc5249f1ae92be536238cd # Expected behavior The file should be checked for errors on startup of Windows Terminal. If there is an error it should fallback to a default config also see #1404 # Actual behavior Windows Terminal does not start. no error message. # workaround fully reset the app in app and features
claunia added the Resolution-Fix-AvailableArea-SettingsIssue-BugProduct-Terminal labels 2026-01-30 22:45:00 +00:00
Author
Owner

@celsojr commented on GitHub (Jun 24, 2019):

IHMO an option like "restore defaults" would be great as well

@celsojr commented on GitHub (Jun 24, 2019): IHMO an option like "restore defaults" would be great as well
Author
Owner

@Shorotshishir commented on GitHub (Jun 24, 2019):

As of now, I couldn't find the fallback values implemented in the source. I believe it is directly dependent on the profile.json, which is really a good thing for testing,
UPDATE : they are in the DefaultSettings.h,
There should be a file that keeps the default values as it comes. the profile.json should be the file that overrides the default.json so that, while the user goes full-on experimental on the profile the functionality doesn't hamper. Just warn them that which part is falling back to default. thus giving a regular user quite a good range of customizability without fear and a power user the ultimate access.

@Shorotshishir commented on GitHub (Jun 24, 2019): ~~**As of now, I couldn't find the fallback values implemented in the source.**~~ I believe it is **directly dependent** on the profile.json, which is really a **good thing for testing**, **UPDATE** : they are in the DefaultSettings.h, There should be a file that keeps the default values as it comes. the `profile.json` should be the file that overrides the `default.json` so that, while the user goes full-on experimental on the profile the functionality doesn't hamper. Just warn them that which part is falling back to default. thus giving a regular user quite a good range of customizability without fear and a power user the ultimate access.
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 24, 2019):

We are fairly sure we added a dialog for this... if you’re not seeing it, that’s pretty surprising.

We have an issue tracking having a defaults file. #754

@DHowett-MSFT commented on GitHub (Jun 24, 2019): We are fairly sure we added a dialog for this... if you’re not seeing it, that’s pretty surprising. We have an issue tracking having a defaults file. #754
Author
Owner

@Shorotshishir commented on GitHub (Jun 24, 2019):

@DHowett what I really wanted to point out is to have a separate file with default values like we now have a profile.json.

@Shorotshishir commented on GitHub (Jun 24, 2019): @DHowett what I really wanted to point out is to have a separate file with default values like we now have a `profile.json`.
Author
Owner

@Karl-WE commented on GitHub (Jun 25, 2019):

We are fairly sure we added a dialog for this... if you’re not seeing it, that’s pretty surprising.

We have an issue tracking having a defaults file. #754

Hi @DHowett I can confirm the dialog is popping up in some certain conditions.
see this image:
image

example:
prerequisited: Windows Terminal is opened
user edits xml e.g. Notepad++ or code write uwp app
proflle.json gets edited and contains a parsing error
hit the save button in your editor > terminal will make a popup

possible problems:
editors with no code highlighting might be an issue - user problem
the error message will popup as a modal window, however if a user has terminal in the background he might not be aware about this
additionally the modal window will NOT prevent to close the Terminal from the taskbar (right click > close)

current situation:
there seems to be a fix since my report. Terminal will open with default settings
image

suggestion:
prevent closing the terminal app with an active modal window that is warning you about a json parsing error.

implement a button to reset the profile.json. in case it is corrupted there is no other way than Windows apps reset at the moment

@Karl-WE commented on GitHub (Jun 25, 2019): > We are fairly sure we added a dialog for this... if you’re not seeing it, that’s pretty surprising. > > We have an issue tracking having a defaults file. #754 Hi @DHowett I can confirm the dialog is popping up in some certain conditions. see this image: ![image](https://user-images.githubusercontent.com/45657752/60122745-27c2cb00-9786-11e9-950c-91fe33007b63.png) example: prerequisited: Windows Terminal is opened user edits xml e.g. Notepad++ or code write uwp app proflle.json gets edited and contains a parsing error hit the save button in your editor > terminal will make a popup possible problems: editors with no code highlighting might be an issue - user problem the error message will popup as a modal window, however if a user has terminal in the background he might not be aware about this additionally the modal window will NOT prevent to close the Terminal from the taskbar (right click > close) current situation: there seems to be a fix since my report. Terminal will open with default settings ![image](https://user-images.githubusercontent.com/45657752/60123288-63aa6000-9787-11e9-9ec6-7d91d6bc647d.png) suggestion: prevent closing the terminal app with an active modal window that is warning you about a json parsing error. implement a button to reset the profile.json. in case it is corrupted there is no other way than Windows apps reset at the moment
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 27, 2019):

This'll be helped in part by #1348. The dialog should be working in all cases. Feel free to open a new issue if the dialog really isn't working.

@DHowett-MSFT commented on GitHub (Jun 27, 2019): This'll be helped in part by #1348. The dialog should be working in all cases. Feel free to open a new issue if the dialog really isn't working.
Author
Owner

@Karl-WE commented on GitHub (Jun 29, 2019):

Agreed.

@Karl-WE commented on GitHub (Jun 29, 2019): Agreed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2031