# System map — microsoft/terminal

> Canonical page: https://codevetter.com/unpack/terminal/system-map

# System map — microsoft/terminal

Scanned commit 7c92ecd037476f957809d0813b14d8bc44bb071a (2026-09-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The repo is one MSBuild workspace (OpenConsole.slnx) producing several binaries: WindowsTerminal.exe (the packaged terminal app, entrypoint in src/cascadia/WindowsTerminal/main.cpp), conhost.exe/OpenConsole.exe (src/host/exe), a wt.exe CLI shim, a shell extension, and many DLL/LIB components under src/cascadia and src/terminal. The terminal app is a Win32 process hosting WinUI 3 XAML islands; a single-instance 'WindowEmperor' owns all windows. Terminal functionality is layered: TerminalConnection (process/pipe IO) -> TerminalControl/ControlCore (XAML + renderer glue) -> TerminalCore (buffer + VT state machine) -> renderer/atlas (D3D text rendering). The conhost side lives under src/host and src/server and talks to the ConDrv driver. Build is MSBuild via tools/razzle.cmd + bcz.cmd or the OpenConsole.psm1 module; CI is Azure Pipelines (build/pipelines), with GitHub Actions only for release publishing and spell-checking.
- The repo builds three products: Windows Terminal, Windows Terminal Preview, and the Windows console host (conhost.exe), plus shared components, ColorTool, and Console API samples. — [README.md#L42-50](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/README.md#L42-L50)
- WindowsTerminal.exe entrypoint is wWinMain in src/cascadia/WindowsTerminal/main.cpp: it registers the 'Microsoft.Windows.Terminal.Win32Host' TraceLogging provider, resets Ctrl handlers, calls EnsureNativeArchitecture() to block wrong-arch launches, enables WM_POINTER, initializes the thread as STA, then constructs a WindowEmperor and calls HandleCommandlineArgs(nCmdShow). — [src/cascadia/WindowsTerminal/main.cpp#L85-125](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/main.cpp#L85-L125)
- WindowEmperor is the single-instance owner of all terminal windows: it builds a branding/elevation/SID-scoped window class name (e.g. 'Windows Terminal Admin <hash> <hash>'), acquires a named mutex or hands the serialized command line to the existing instance via WM_COPYDATA, then runs the process-wide GetMessageW loop that pumps every AppHost window. — [src/cascadia/WindowsTerminal/WindowEmperor.cpp#L483-545](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/WindowEmperor.cpp#L483-L545) [src/cascadia/WindowsTerminal/WindowEmperor.cpp#L643-715](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/WindowEmperor.cpp#L643-L715)
- Each visible window is an AppHost wrapping a XAML-island HWND (IslandWindow/NonClientIslandWindow); windows are created by WindowEmperor::CreateNewWindow which constructs AppHost with WindowRequestedArgs and tracks them in _windows. — [src/cascadia/WindowsTerminal/AppHost.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/AppHost.cpp) [src/cascadia/WindowsTerminal/IslandWindow.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/IslandWindow.cpp) [src/cascadia/WindowsTerminal/WindowEmperor.cpp#L249-297](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/WindowEmperor.cpp#L249-L297)
- The terminal app's code is split into projects under src/cascadia: TerminalApp (window/page/tab/pane UI + actions), TerminalControl (XAML control + ControlCore), TerminalCore (UI-agnostic terminal: buffer, VT parser wiring), TerminalSettingsModel (settings.json model), TerminalConnection (ConPTY/Azure/Echo connection types), TerminalSettingsEditor (Settings UI), plus helpers (ElevateShim, ShellExtension, wt shim, WpfTerminalControl). — [doc/ORGANIZATION.md](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/doc/ORGANIZATION.md) [src/cascadia/TerminalApp/TerminalPage.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/TerminalApp/TerminalPage.cpp) [src/cascadia/TerminalControl/TermControl.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/TerminalControl/TermControl.cpp)
- Client processes are spawned through ConPTY: ConptyConnection::Start calls ConptyCreatePseudoConsole (statically linked from src/inc/conpty-static.h / src/winconpty) then _LaunchAttachedClient uses CreateProcessW with PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE. — [src/cascadia/TerminalConnection/ConptyConnection.cpp#L400-427](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/TerminalConnection/ConptyConnection.cpp#L400-L427) [src/cascadia/TerminalConnection/ConptyConnection.cpp#L32-53](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/TerminalConnection/ConptyConnection.cpp#L32-L53) [src/inc/conpty-static.h](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/inc/conpty-static.h)
- conhost.exe is built from src/host/exe (Host.EXE.vcxproj) with wWinMain in exemain.cpp; it registers COM out-of-proc class objects (including CConsoleHandoff for incoming ConPTY handoff), honors the HKCU\Console ForceV2 registry value for the legacy console, and initializes the server side under src/server (ConDrvDeviceComm, IoDispatchers, ApiDispatchers). — [src/host/exe/exemain.cpp#L24-120](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/host/exe/exemain.cpp#L24-L120) [src/host/exe/CConsoleHandoff.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/host/exe/CConsoleHandoff.cpp) [src/server/IoDispatchers.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/server/IoDispatchers.cpp) [src/server/ConDrvDeviceComm.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/server/ConDrvDeviceComm.cpp)
- wt.exe is a ~40-line shim (src/cascadia/wt/shim.cpp) that replaces its own filename with WindowsTerminal.exe in the same directory and CreateProcessW's it, prepending its own name (wt/wtd) to the command line. — [src/cascadia/wt/shim.cpp](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/wt/shim.cpp)
- Packaging is MSIX via src/cascadia/CascadiaPackage/CascadiaPackage.wapproj with four branding manifests (Package.appxmanifest, Package-Pre.appxmanifest, Package-Can.appxmanifest, Package-Dev.appxmanifest) selected by WT_BRANDING_* macros. — [src/cascadia/CascadiaPackage/Package.appxmanifest](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/CascadiaPackage/Package.appxmanifest) [src/cascadia/WindowsTerminal/WindowEmperor.cpp#L485-497](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/cascadia/WindowsTerminal/WindowEmperor.cpp#L485-L497)
- Third-party dependencies are managed by vcpkg (vcpkg.json): fmt 12.1.0, ms-gsl 4.2.2, jsoncpp 1.9.6, cli11 2.6.1, cmark 0.31.1, with overlay ports/triplets under dep/vcpkg-overlay-*. — [vcpkg.json](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/vcpkg.json)
- The master build is OpenConsole.slnx (XML solution listing ~all vcxproj/csproj/wapproj with AuditMode/Debug/Fuzzing/Release configs on x86/x64/arm64); conhost.slnf is a filtered solution for conhost-only work, and Scratch.sln exists for experiments. — [OpenConsole.slnx](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/OpenConsole.slnx) [conhost.slnf](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/conhost.slnf)
- Developer builds run through tools/: razzle.cmd sets up the environment, bcz.cmd/bx.cmd wrap MSBuild Clean;Build, and tools/OpenConsole.psm1 provides Invoke-OpenConsoleBuild/Set-MsBuildDevEnvironment; tests run via tools/runut.cmd, runft.cmd, runuia.cmd. — [tools/razzle.cmd](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/tools/razzle.cmd) [tools/bcz.cmd](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/tools/bcz.cmd) [tools/OpenConsole.psm1](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/tools/OpenConsole.psm1) [README.md#L355-375](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/README.md#L355-L375)
- CI is Azure Pipelines, not GitHub Actions: build/pipelines/ci.yml runs an Audit x64 stage, a code-format check (templates-v2/job-check-code-format.yml), and per-platform builds for x64/x86/arm64 with a runTests parameter; the three .github/workflows files only handle winget publishing, check-spelling, and project-board automation. — [build/pipelines/ci.yml](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/build/pipelines/ci.yml) [.github/workflows/winget.yml](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/.github/workflows/winget.yml) [.github/workflows/spelling2.yml](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/.github/workflows/spelling2.yml)
- Feature flags are declared in src/features.xml (e.g. Feature_ReceiveIncomingHandoff, Feature_AttemptHandoff, Feature_ConhostAtlasEngineCustomShaders) with per-branding alwaysEnabled/alwaysDisabled tokens, and turned into TIL_FEATURE_* macros by tools/Generate-FeatureStagingHeader.ps1. — [src/features.xml](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/src/features.xml) [tools/Generate-FeatureStagingHeader.ps1](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/tools/Generate-FeatureStagingHeader.ps1) [doc/feature_flags.md](https://github.com/microsoft/terminal/blob/7c92ecd037476f957809d0813b14d8bc44bb071a/doc/feature_flags.md)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
