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.xmldeclares<uap3:AppExtension Name="com.microsoft.windows.terminal.settings" PublicFolder="Terminal"/>, andTerminal\Fragments\terminal.jsonin 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 inTERMINAL_PROFILE_NAMESPACE_GUID({2bde4a90-d05f-401c-9492-e40884ead1d8}); - a new profile "Ubuntu" running
ubuntu.exewith"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.
- a profile entry
- 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(withshortcut.icobeside the disk) andTerminalProfilePath, 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" runningwsl.exe --distribution-id {…}withstartingDirectory "~", the distribution'sshortcut.icoand"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
Fragmentsfolder 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:
%LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\<app>\*.json;%ProgramData%\Microsoft\Windows Terminal\Fragments\<app>\*.json(Windows Terminal's two folders;<app>is the source);- for each WSL distribution with a
TerminalProfilePath(WSL 2.4 and later) that is a local.jsonfile not already read: that file, with the sourceMicrosoft.WSL; - for each WSL distribution with a
PackageFamilyName: that family's main package (not a_split.resource package or a_~_bundle), itsAppxManifest.xml(at most 256 KiB), thePublicFolderof itscom.microsoft.windows.terminal.settingsextension (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[]:nameand Windows Terminal's colour keys, converted to a Ghostty theme file:black…whitearepalette0 to 7,brightBlack…brightWhite8 to 15 (purpleis magenta),background,foreground,cursorColoriscursor-color,selectionBackgroundisselection-background. Colours are#rgb,#rrggbbor#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"}) andhidden. Everything else (fonts, cursor shape,elevate, actions) is ignored.- Icons: an
.ico,.png,.exeor.dllthat exists.ms-appx:///xis 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-100and.scale-200. URLs, glyphs and emoji are skipped. PNG icons are read withCreateIconFromResourceEx(Windows Vista and later decode PNG icon resources), which also makesv7-profile-iconaccept 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).
- An
updatesentry changes the detected profile with that GUID: its scheme, icon andhidden. Its command, name and starting directory stay (a WSL fragment's~is the Linux home, which Voyager7'swsl.exe --cd ~already gives). - A new profile (with
guidorname) matching a detected profile by GUID or by name (ignoring case) changes that profile in the same way, and itshidden(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'swsl.exe -d Ubuntu --cd ~, with Ubuntu's scheme and icon. - 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.
- Any other new profile with a
nameand acommandlineis added (itsstartingDirectorytoo,~ashome), 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-profilesasfragments_us). - Packaged non-WSL fragment apps are not covered without WinRT.