Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Windows Terminal JSON fragments

Status: proposed. Date: 2026-11-30. Owner approved: no.

Windows Terminal opens the Ubuntu distribution in Ubuntu's purple scheme. That scheme is not Windows Terminal's: the Ubuntu Store package ships it in a JSON fragment extension, which also hides WSL's generated Ubuntu profile and adds its own. Other apps ship fragments too: Git for Windows (optionally), other WSL distributions and tools. Voyager7 reads them, read only, so that a profile looks the way the app that installed it asked (owner request 2026-11-30: "can we have Ubuntu apply theme automatically like PowerShell Campbell?").

Sources read: Windows Terminal src/cascadia/TerminalSettingsModel (CascadiaSettingsSerialization.cpp: FindFragmentsAndMergeIntoUserSettings, _parseFragment; DynamicProfileUtils.cpp: CreateDynamicProfile; src/types/utils.cpp: CreateV5Uuid), MIT, for reference only; and what is on the owner's Windows 10 VM (Ubuntu 2604.1.75.0 from the Store, Windows Terminal 1.25.3131.0).

What is on Windows 10 with Ubuntu

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss\{guid} names the distribution (DistributionName = Ubuntu) and its package (PackageFamilyName = CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc).
  • The package's AppxManifest.xml declares <uap3:AppExtension Name="com.microsoft.windows.terminal.settings" PublicFolder="Terminal"/>, and Terminal\Fragments\terminal.json in the package folder holds:
    • a profile entry "updates": "{2c4de342-38b7-51cf-b940-2309a097f518}" with "hidden": true. That GUID is Windows Terminal's generated GUID for the WSL distribution "Ubuntu": a version 5 UUID of the UTF-16 name in TERMINAL_PROFILE_NAMESPACE_GUID ({2bde4a90-d05f-401c-9492-e40884ead1d8});
    • a new profile "Ubuntu" running ubuntu.exe with "colorScheme": "Ubuntu-ColorScheme" and "icon": "ms-appx:///Assets/Square44x44Logo.targetsize-32.png";
    • the schemes "Ubuntu-ColorScheme" (background #300A24) and "Ubuntu-Light-ColorScheme". The file has // comments, which Windows Terminal's JSON parser accepts.
  • Later the same day the owner finished Ubuntu's setup, and WSL (2.4 or later) re-registered it as a "Modern" distribution: the Lxss key no longer names a package but has Modern = 1, ShortcutPath (a Start menu .lnk), BasePath (with shortcut.ico beside the disk) and TerminalProfilePath, a fragment WSL itself wrote: %LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\Microsoft.WSL\{0116a667-…}.json. It hides the generated "Ubuntu" the same way and adds "Ubuntu" running wsl.exe --distribution-id {…} with startingDirectory "~", the distribution's shortcut.ico and "colorScheme": "Ubuntu", and defines the schemes "Ubuntu" (Canonical's values, as in the Store package's) and "Ubuntu Light". So both kinds of install give Windows Terminal a fragment.
  • There was no machine Fragments folder on that VM.
  • Windows records app extensions in its state repository database, not in the registry: no registry key or value names com.microsoft.windows.terminal.settings. The registry does list each user package's folder: HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\<full name>\PackageRootFolder, with the full names of a family under …\Repository\Families\<family>.

Where Voyager7 looks

Windows 10 and later only; on Windows 7 nothing is read (there is no Windows Terminal there). In this order, at most 32 files of at most 256 KiB:

  1. %LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\<app>\*.json;
  2. %ProgramData%\Microsoft\Windows Terminal\Fragments\<app>\*.json (Windows Terminal's two folders; <app> is the source);
  3. for each WSL distribution with a TerminalProfilePath (WSL 2.4 and later) that is a local .json file not already read: that file, with the source Microsoft.WSL;
  4. for each WSL distribution with a PackageFamilyName: that family's main package (not a _split. resource package or a _~_ bundle), its AppxManifest.xml (at most 256 KiB), the PublicFolder of its com.microsoft.windows.terminal.settings extension (a plain relative folder: no .., drive or root), then <package>\<PublicFolder>\Fragments\*.json.

Windows Terminal asks the WinRT AppExtensionCatalog for every package with the extension. Voyager7 does not use WinRT, and without it the only general way is to open every package's manifest: 74 packages, 1.4 MB of manifests on the owner's VM, too much for the UI thread. WSL distributions, the case that matters, name their package in the registry, so only theirs is opened. A packaged app that is not a WSL distribution and ships a fragment is not read; apps that install unpackaged (Git for Windows) use the folders above. Visual Studio's developer shells are Windows Terminal's own generators, not fragments, and are not covered here.

What is read

The JSON is other apps' input. The parser is Voyager7's own: JSON plus // and /* */ comments and trailing commas (what Windows Terminal's parser accepts), at most 16 levels deep and 16,384 values; a file that does not parse is skipped whole and reported to the debug output. Unknown keys are ignored. Nothing is started, loaded or written.

  • schemes[]: name and Windows Terminal's colour keys, converted to a Ghostty theme file: black … white are palette 0 to 7, brightBlack … brightWhite 8 to 15 (purple is magenta), background, foreground, cursorColor is cursor-color, selectionBackground is selection-background. Colours are #rgb, #rrggbb or #rrggbbaa (alpha dropped). A name that is not a usable theme name (empty, too long, or containing , = : " \ / or control characters) is skipped. At most 64 schemes; the first of a name wins.
  • profiles (an array, or {"list": [...]}): guid, updates, name, commandline, startingDirectory (both with %VAR% expanded), icon, colorScheme (a name, or {"light", "dark"}) and hidden. Everything else (fonts, cursor shape, elevate, actions) is ignored.
  • Icons: an .ico, .png, .exe or .dll that exists. ms-appx:///x is in the fragment's package; a relative path is in the fragment's folder. A packaged PNG named without its resource qualifier is also looked for as .targetsize-32, .targetsize-24, .scale-100 and .scale-200. URLs, glyphs and emoji are skipped. PNG icons are read with CreateIconFromResourceEx (Windows Vista and later decode PNG icon resources), which also makes v7-profile-icon accept a .png.

How it merges with detection (ADR 0013)

Every detected profile has the GUID Windows Terminal gives it: Command Prompt's fixed {0caa0dad-…}, else the version 5 UUID of its name (this matches Windows PowerShell's {61c54bbd-…}, PowerShell 7's and every WSL distribution's).

  1. An updates entry changes the detected profile with that GUID: its scheme, icon and hidden. Its command, name and starting directory stay (a WSL fragment's ~ is the Linux home, which Voyager7's wsl.exe --cd ~ already gives).
  2. A new profile (with guid or name) matching a detected profile by GUID or by name (ignoring case) changes that profile in the same way, and its hidden (default false) replaces the detected one's. So Ubuntu's fragment hides the generated "Ubuntu" and shows its own "Ubuntu": one visible "Ubuntu" profile, still running Voyager7's wsl.exe -d Ubuntu --cd ~, with Ubuntu's scheme and icon.
  3. A file that hides exactly one detected profile and adds exactly one unmatched new profile replaces it: the detected profile takes the new one's name as its shown name (so "Ubuntu-22.04" shows "Ubuntu 22.04 LTS") and keeps its key, command and profile file.
  4. Any other new profile with a name and a commandline is added (its startingDirectory too, ~ as home), after the detected ones, unless it is hidden; at most 64 profiles in all, and a name already listed is not added again. It behaves like a detected profile.

A profile file (profiles\NAME.ghostty) still wins over all of this. A profile a fragment hid stays hidden until its file says v7-profile-hidden = false; Settings' Hidden box writes that.

Default themes

A fragment's colorScheme becomes the profile's default theme when every name it uses is a fragment scheme or a built-in theme. Fragment schemes are found as themes after the themes folder and the built-in collection, so a profile file's theme = Ubuntu-ColorScheme finds it too. A default theme from a fragment is looked up in the fragments first: WSL's own fragment names its scheme "Ubuntu", the name of a different built-in theme, and in Windows Terminal a fragment's scheme wins over an inbox scheme of the same name. A theme = the user writes keeps Ghostty's order. A light/dark pair becomes theme = light:A,dark:B and follows the app mode (ADR 0016).

The rule is ADR 0016's for Campbell Powershell, unchanged: the default theme applies to a detected profile that is not the default profile, while neither the main configuration nor the profile's file sets theme or a colour key. A fragment's scheme takes precedence over the PowerShell rule. Unlike the PowerShell rule, which follows the command, a fragment's theme belongs to the profile: a profile file that changes only command keeps it, as Windows Terminal keeps a profile's scheme when you change its command.

Ubuntu without a fragment (an older WSL, a distribution imported with wsl --import, or fragments off): a detected distribution whose name starts with "Ubuntu" has the built-in Ubuntu theme by default, by the same rule. Ghostty's "Ubuntu" theme (iTerm2-Color-Schemes, MIT) has the same #300a24 background and the Tango palette that Ubuntu's terminal used; Canonical's fragment differs in details (black #1b1b1b for #2e3436, white foreground). Canonical's values are not copied: they are not needed for the look, and the package states no licence for them. With the fragment present, its own values are used, read from the user's disk.

Settings → Profiles tags each profile row that has a default theme with the theme and its source, muted and right-aligned where "default" and "hidden" already appear: "Ubuntu · WSL", "Campbell Powershell · Windows Terminal", "Ubuntu · built in". The tag is cut with an ellipsis before it reaches the name. +version --full lists the apps whose fragments were read ("WT fragments") and each profile's default theme ("profile themes"), and --diag-profiles lists the files, schemes and timings.

Detection also gets a WSL distribution's icon right on WSL 2.4: its ShortcutPath is a .lnk, which is not an icon, so the distribution's shortcut.ico beside its disk (BasePath) is used, else wsl.exe's.

The key

v7-profile-fragments: "Add the profiles, icons and colour schemes that other apps give Windows Terminal in JSON fragments, such as Ubuntu's, on Windows 10 and later. Values: true, false. Default: true." Fragments are read only while v7-profiles and v7-profile-detect are on. Windows Terminal has no such switch, but it lets users disable a fragment source; a switch keeps Voyager7's list predictable for users who do not use Windows Terminal.

Consequences

  • An Ubuntu tab looks as it does in Windows Terminal, with Ubuntu's icon, unless it is the default profile or the user set colours.
  • Detection reads up to 32 more small files and one manifest per packaged WSL distribution, once per configuration load, on the UI thread (timed in --diag-profiles as fragments_us).
  • Packaged non-WSL fragment apps are not covered without WinRT.