跪拜 Guibai
← All articles
Frontend · Backend

Windows 11 Terminal Beautification: A Complete From-Scratch Guide

By Mia_墨黎 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Windows terminal customization has long been fragmented across half-documented layers; this guide gives a complete, testable path that works for both English and CJK users, and its offline script makes the whole setup reproducible on a fresh machine without hitting network issues.

Summary

This guide maps the four independent layers of a modern Windows terminal — Windows Terminal as host, PowerShell 7 as shell, Oh My Posh as prompt renderer, and Nerd Font for icons — and stresses the correct configuration order: terminal, font, prompt, completion, tools. Getting the font wrong cascades into every other layer showing square boxes for icons.

The 10-minute quick start installs Oh My Posh via winget, picks a Nerd Font, copies all built-in OMP themes to a user directory, and sets up a profile that reads an active-theme text file. A full profile template includes UTF-8 encoding, PSReadLine history search and list-view prediction, zoxide, Terminal-Icons, bat, eza, and a poshtheme/poshthemes pair for switching OMP themes on the fly without editing JSON.

Troubleshooting covers the most common failures: font not found after install, Chinese text misaligning because a non-CJK font falls back to Microsoft YaHei, MSIX versions of Oh My Posh hiding themes from the documented environment variable, and slow prompts from Git fetch_status. Every step is reversible, with backup commands for settings.json and a full uninstall list for software and modules.

Takeaways
— Terminal beautification has four independent layers: Windows Terminal, PowerShell 7, Oh My Posh, and Nerd Font; configure them in that order.
— A font without CJK glyphs makes Windows Terminal fall back to Microsoft YaHei, which breaks width alignment for Chinese text; use Maple Mono NF CN or Sarasa Term SC Nerd Font for Chinese.
— Charging text like Powerline arrows and Git branch icons requires a Nerd Font with 3000+ patched glyphs; installing the non-NF version leads to square boxes.
— When Oh My Posh is installed via MSIX, the POSH_THEMES_PATH environment variable may be empty, so themes must be located via Get-AppxPackage or the WindowsApps directory.
— Copying all OMP themes into $HOME/.config/oh-my-posh prevents breakage after Oh My Posh upgrades change the install path.
— The provided profile template uses existence checks so missing tools are skipped without errors, and includes a poshtheme function that switches themes by writing to active-theme.txt and reinitializing the session.
— PSReadLine prediction with HistoryAndPlugin plus ListView gives inline gray predictions and a selection list, with Tab as menu completion and Up/Down as prefix history search.
— Installing CompletionPredictor improves PSReadLine prediction to include command parameters from modules, not just history.
— The unified color scheme approach sets the same Catppuccin Mocha palette across Windows Terminal, Oh My Posh, bat, delta, and PSReadLine highlighting.
— For large Git repositories, disabling Oh My Posh's fetch_status is the most effective way to reduce prompt latency.
— zoxide can replace cd with fuzzy directory jumping, and fzf + PSFzf brings fuzzy history search and file insertion to the command line.
— Windows Terminal's font fallback is automatic and uncontrolled; the only reliable fix for CJK alignment is choosing a font that already includes Chinese.
— VS Code's integrated terminal needs its own fontFamily setting; it doesn't inherit Windows Terminal settings.
— The guide provides a rollback path: back up settings.json and profile, uninstall packages via winget, and remove fonts through Settings or registry.
— An optional script can automate the whole setup for new machines, using marker blocks in the profile and backup before merging settings.json.
Conclusions

Most terminal beautification tutorials treat font choice as an afterthought, but the guide correctly identifies it as the root cause of almost every display failure.

The emphasis on CJK width issues makes this guide unusually practical for the many developers who work with Chinese text, a crowd most English-language Windows terminal guides ignore.

The MSIX theme path pitfall represents a real documentation gap in Oh My Posh itself; the workaround shown here is more robust than the official docs suggest.

Copying themes out of the install directory is a smart engineering pattern: it decouples user configuration from package updates and makes theme files easy to back up or sync.

The unified palette approach across six tools is a rare level of visual coherence; most setups leave bat or delta mismatched.

The guide's insistence on plain-text config and full rollback mirrors good infrastructure practice, treating a terminal setup like code that can be reverted and re-run.

Concepts & terms
Nerd Font
A monospaced programming font that has been patched with over 3000 icons and glyphs from icon sets like Font Awesome, Powerline, and Devicons, enabling terminal tools to render arrows, branch symbols, and file type icons that ordinary fonts lack.
Oh My Posh
A cross-platform prompt engine that renders a highly customizable prompt line in PowerShell, bash, zsh, and other shells, showing path, Git status, execution time, and language version via JSON-configured segments.
PSReadLine
PowerShell's line editor module that provides syntax highlighting, command history, Tab completion, and predictive suggestions, with a plugin architecture for adding richer completion sources.
zoxide
A smart cd replacement that learns the directories you frequently visit and lets you jump to them with fuzzy partial matches, such as 'z proj' for any commonly used path containing 'proj'.
Acrylic (useAcrylic)
Windows 10/11's frosted glass transparency effect, applied to the terminal background for a blurred, see-through look; enabled with the useAcrylic setting in Windows Terminal.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗