34

I edited the settings file and there must have been a typo and now the app crashes on startup.

Online the documentation says the settings lives in $env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json

I can't figure out what that path means since it doesn't exist on the computer.

1mike12
  • 2,946
  • 3
  • 27
  • 36
  • 7
    By the way, `$env:LocalAppData` is the way Powershell refers to environment variables. In CMD the equivalent would be `%LocalAppData%`. Moreover, the CMD version is accepted by File Explorer, so you could just paste `%LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState` in the address bar and it would open the folder. – vyrp Jan 10 '21 at 12:12
  • what a shitty programming solution... this file should be in the same older as the program (the general... ot the only ~99% use cases)... and for the ~1% specific cases in the %USREPROFILE%/$home .terminal.json file... – ZEE Mar 07 '23 at 14:23

6 Answers6

40

I re-installed the app to fix the problem then made sure to see what the actual path is.

It's located in : C:\Users\{USERNAME}\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState

1mike12
  • 2,946
  • 3
  • 27
  • 36
13

In the current version (1.7.1033.0), the application can open the JSON settings file for you via a button. Open the Settings tab, and the bottom left corner will have a button named "Open JSON file". Clicking that button will open a prompt asking with what application to open the file. That text editor can then tell you where the file is located.

Screenshot

SebastianC
  • 522
  • 5
  • 10
  • Stupid question: how do you open the settings tab? I can open the file directly with Ctrl+Alt+, (i.e. Ctrl+Alt+comma). Ok, I found it: it's Ctrl+, (i.e. Ctrl+comma) to open GUI version of the settings. – Fizz Jan 28 '22 at 14:33
  • @Fizz Based on my screenshot: you click the little down-arrow-button next to the + button when creating a new tab. Settings is available as a choice in addition to the different terminals. – SebastianC Feb 21 '22 at 14:23
  • There is no arrow on my powershell executed as admin. Would you know where that could come from ? – Yoann Buzenet Sep 21 '22 at 16:33
  • For me it looks the same as https://stackoverflow.com/a/66003513/4462442 – SebastianC Sep 28 '22 at 07:57
7

If you open the terminal settings, it will open a text editor with the settings.json file. If your default editor is VS Code it will show you the path below the tabs on the top of the screen.

Settings menu in Windows Terminal

I'm unsure what other editors show you the path, but if it is crucial you can change your default text editor to Code.

Daniel
  • 368
  • 1
  • 4
  • 6
  • 1
    No, it will not "open a text editor" - in my case it opens damned Visual Studio, whose "community" license expired and Microsoft wants me to Log in and "refresh" the "community" license - like hell I will! Good to know after all it is just a file, so I can open it in something else. – sdbbs May 02 '21 at 15:46
  • In this case OP specifically states they're unable to launch the program because the settings are invalid, so this doesn't help. – user4520 Jun 02 '21 at 09:11
2

For those who are running Windows Terminal through the .zip folder download, the settings file will be located in:

C:\Users{username}\AppData\Local\Microsoft\Windows Terminal

1

There is still the option to open the JSON file through settings. In version 1.15.2875.0 you can still find the "Open JSON file" at the bottom left corner

Screenshot with highlights

michaelxq
  • 11
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 04 '22 at 17:32
-1

This hint was given by a comment by user1340531:

Mine is at C:\Users\{username}\AppData\Local\Microsoft\Windows Terminal\settings.json

(or more generically: %userprofile%\AppData\Local\Microsoft\Windows Terminal\settings.json)


If it's not there, you should consider OP's answer or vyps comment which lets you find out one of these generic paths (they are equivalent):

%userprofile%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
             %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
          $env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState

If you don't know what these paths mean, I'd recommend playing around with "Windows Run" (Win+R) and the explorer address bar.

Cadoiz
  • 1,446
  • 21
  • 31