Terminal: Windows Terminal may not open if profiles.json is corrupted

Created on 24 Jun 2019  路  7Comments  路  Source: microsoft/terminal

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

Area-Settings Issue-Bug Product-Terminal Resolution-Fix-Available

Most helpful comment

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

All 7 comments

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

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.

We are fairly sure we added a dialog for this... if you鈥檙e not seeing it, that鈥檚 pretty surprising.

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

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

We are fairly sure we added a dialog for this... if you鈥檙e not seeing it, that鈥檚 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

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.

Agreed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ronkiro picture Ronkiro  路  65Comments

MoshiBin picture MoshiBin  路  128Comments

DHowett-MSFT picture DHowett-MSFT  路  285Comments

HLFH picture HLFH  路  68Comments

privacyguy123 picture privacyguy123  路  131Comments