Prevent Windows Terminal from (needlessly) changing settings.json #19149

Closed
opened 2026-01-31 06:35:08 +00:00 by claunia · 2 comments
Owner

Originally created by @skrysm on GitHub (Dec 27, 2022).

Discussed in https://github.com/microsoft/terminal/discussions/14380

Originally posted by skrysmanski November 13, 2022
I have a "hand crafted" settings.json since the earliest days of Windows Terminal. I have this file under version control (via Git).

The current version of Windows Terminal (1.15) seems to overwrite/rewrite my settings.json every time Windows Terminal is opened/closed.

Is there any way to prevent Windows Terminal from doing this?

It is, of course, okay that WT rewrites the file if I use the settings UI to change some settings. But it shouldn't do this if I don't use the UI.

Originally created by @skrysm on GitHub (Dec 27, 2022). ### Discussed in https://github.com/microsoft/terminal/discussions/14380 <div type='discussions-op-text'> <sup>Originally posted by **skrysmanski** November 13, 2022</sup> I have a "hand crafted" `settings.json` since the earliest days of Windows Terminal. I have this file under version control (via Git). The current version of Windows Terminal (1.15) seems to overwrite/rewrite my `settings.json` every time Windows Terminal is opened/closed. Is there any way to prevent Windows Terminal from doing this? It is, of course, okay that WT rewrites the file if I use the settings UI to change some settings. But it shouldn't do this if I don't use the UI.</div>
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-31 06:35:08 +00:00
Author
Owner

@j4james commented on GitHub (Dec 30, 2022):

In most cases it shouldn't be updating your settings.json file as far as I can tell. Outside of you actually editing something in the Settings GUI, the only other scenarios in which it might save of its own accord are when a dynamic profile is generated, or when fixing up profiles where the command line is something like cmd.exe or powershell.exe (i.e. without a path). Is it possible that the latter case applies to you?

It's also worth mentioning that there is an open issue to try and make it do a better job of preserving the original json structure when rewriting the settings (see #8991). Hopefully then it would be less of an issue for you when the terminal does need to force an update for some reason.

@j4james commented on GitHub (Dec 30, 2022): In most cases it shouldn't be updating your `settings.json` file as far as I can tell. Outside of you actually editing something in the Settings GUI, the only other scenarios in which it might save of its own accord are when a dynamic profile is generated, or when fixing up profiles where the command line is something like `cmd.exe` or `powershell.exe` (i.e. without a path). Is it possible that the latter case applies to you? It's also worth mentioning that there is an open issue to try and make it do a better job of preserving the original json structure when rewriting the settings (see #8991). Hopefully then it would be less of an issue for you when the terminal does need to force an update for some reason.
Author
Owner

@skrysm commented on GitHub (Dec 30, 2022):

the only other scenarios in which it might save of its own accord are when a dynamic profile is generated, or when fixing up profiles where the command line is something like cmd.exe or powershell.exe (i.e. without a path). Is it possible that the latter case applies to you?

Yes, this was exactly the case and your answer is exactly what I was looking for. Thank you. :)

@skrysm commented on GitHub (Dec 30, 2022): > the only other scenarios in which it might save of its own accord are when a dynamic profile is generated, or when fixing up profiles where the command line is something like `cmd.exe` or `powershell.exe` (i.e. without a path). Is it possible that the latter case applies to you? Yes, this was exactly the case and your answer is exactly what I was looking for. Thank you. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19149