Windows 11 终端美化完全指南
适用环境:Windows 11 22H2 及以上、Windows Terminal 1.20+、PowerShell 7.2+ 标签栏 UI 主题:需要 Windows Terminal 1.24 及以上(见 3.5 节) 目标:从「白底黑字、满屏方块」到「毛玻璃、Nerd 图标、Git 状态、智能补全」的现代化终端 阅读方式:赶时间 → 看第 2 章「10 分钟速通」;想一次搞明白 → 从第 0 章顺序读
效果图
写在前面
这是一篇从零开始的 Windows 11 终端美化教程,覆盖 Windows Terminal 外观、Nerd Font、Oh My Posh 提示符、PSReadLine 补全、常用命令行工具,以及一套可以直接使用的 profile。
文中以 Catppuccin Mocha 和 Tokyo Night Storm 两套配色为例,但所有步骤都不绑定具体主题:你可以换成任意喜欢的配色和 OMP 主题。
本文以较新的 Windows Terminal 和 Oh My Posh 版本为例;遇到版本差异时,文中会注明兼容范围。
- 不需要重装系统,所有配置都在用户目录
- 每一步都可以单独回滚,文末有卸载与恢复章节
- 命令默认在 PowerShell 7 中执行,不是 Windows PowerShell 5.1
目录
0. 先搞清楚:你到底在美化什么
很多人一上来就抄一堆配置,结果不知道哪一层出了问题。终端美化其实只有四层:
┌─────────────────────────────────────────────────────┐
│ Windows Terminal(终端宿主) │
│ 负责:窗口、标签、字体渲染、配色、透明度、背景图 │
│ ┌───────────────────────────────────────────────┐ │
│ │ PowerShell 7(Shell) │ │
│ │ 负责:执行命令、历史记录、补全、语法高亮 │ │
│ │ ┌─────────────────────────────────────────┐ │ │
│ │ │ Oh My Posh(提示符框架) │ │ │
│ │ │ 负责:路径、Git 分支、耗时、版本号… │ │ │
│ │ └─────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────┘ │
│ 字体(Nerd Font):提供箭头、文件/语言图标与等宽对齐 │
└─────────────────────────────────────────────────────┘
正确顺序:终端 → 字体 → 提示符 → 补全 → 工具链。 字体不对,后面所有图标都会变成方块——这是新手最常见的翻车点。
1. 环境自检
先花 1 分钟确认现状。在 PowerShell 7 里执行(不是 Windows PowerShell 5.1):
# 1. PowerShell 版本,应为 7.x
$PSVersionTable.PSVersion
# 2. Windows Terminal 是否存在
(Get-Command wt.exe).Source
# 3. PowerShell 7 的配置文件路径(不存在是正常的)
$PROFILE
Test-Path $PROFILE
# 4. 执行策略,RemoteSigned 即可
Get-ExecutionPolicy -List
# 5. 是否已装 Nerd Font(有输出说明装过)
@(
(Get-ItemProperty 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
) | Where-Object { $_ -match 'Nerd|NF|Maple|Cascadia|Sarasa|Meslo' } | Sort-Object -Unique
怎么判断自己的环境:
只要 PowerShell 7 和 Windows Terminal 就位,其他组件都可以边做边装。本文不要求先清理旧配置;profile 和 settings.json 都是纯文本,改坏了可以恢复。
⚠️ 两个 PowerShell 不要搞混
- Windows PowerShell 5.1:系统自带,profile 在 Documents\WindowsPowerShell
- PowerShell 7:你装的,profile 在 Documents\PowerShell
本文所有配置都写在 7 的 profile 里;在 5.1 里不生效是正常的。
2. 10 分钟速通(懒人版)
只想快速变好看,按这 5 步走,细节后面章节再补:
# ① 装 Oh My Posh(已装可跳过)
winget install --id JanDeDobbeleer.OhMyPosh -e --source winget --accept-package-agreements --accept-source-agreements
# ② 装字体(交互式列表,方向键选 CascadiaCode 回车;中文用户见第 4 章)
oh-my-posh font install
# ③ 复制全部主题,写入当前主题,再创建 profile
$ompThemes = if ($env:POSH_THEMES_PATH) { $env:POSH_THEMES_PATH } else { (Get-AppxPackage ohmyposh.cli).InstallLocation + '\themes' }
New-Item -ItemType Directory "$HOME\.config\oh-my-posh" -Force | Out-Null
Copy-Item "$ompThemes\*.omp.json" -Destination "$HOME\.config\oh-my-posh" -Force
Set-Content "$HOME\.config\oh-my-posh\active-theme.txt" 'catppuccin_mocha' -Encoding utf8
New-Item -ItemType File -Path $PROFILE -Force
notepad $PROFILE # 粘贴第 8 章的模板,保存
如果 Get-AppxPackage 报「拒绝访问」,用 5.3 节的 Get-OmpThemesDir 函数代替。
④ 打开 Windows Terminal → Ctrl + , → 外观 → 字体选 Cascadia Code NF(以字体下拉框里显示的名字为准,中文用户选 Maple Mono NF CN),字号 11。配色方案想用 Catppuccin 的话,先把 3.5 节的 JSON 加进 schemes;懒得改就先选内置的 One Half Dark。
⑤ 关掉所有终端标签页,重新打开。应该能看到带图标、带 Git 信息的提示符了。
想更精致(毛玻璃、Catppuccin 配色、智能补全、ll/z/fzf),继续往下读。
3. 第 1 步:Windows Terminal 配置
3.1 把 Windows Terminal 设为默认终端
不设置的话,双击 .ps1、从「运行」启动 cmd 等场景仍会弹出老旧的 conhost 窗口。
方式一(推荐):Windows 设置 → 系统 → 开发者选项 → 找到 终端 → 默认终端应用程序选 Windows Terminal。
方式二:Windows Terminal → Ctrl + , → 启动 → 默认终端应用程序 → Windows Terminal。
3.2 默认打开 PowerShell 7
Ctrl + , → 启动 → 默认配置文件 → 选 PowerShell(图标是黑色 >_ 的那个,不是 Windows PowerShell)。
顺手把 启动时 设为「最大化」或「默认」,看你习惯。
3.3 找到并备份 settings.json
Windows Terminal 的所有外观最终都落在 settings.json 里。GUI 能改的只是子集,透明毛玻璃、背景图、滚动条隐藏、抗锯齿这些必须改 JSON。
Ctrl + , → 左下角 打开 JSON 文件。文件通常在:
# Store 版(绝大多数人)
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
# 非 Store 版(winget / scoop / 便携版)
%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json
备份(强烈建议,改坏了能秒回滚):
$wt = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
if (Test-Path $wt) {
Copy-Item $wt "$wt.bak" -Force
"已备份到 $wt.bak"
} else {
"没找到 Store 版配置,检查 %LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json"
}
💡 也可以直接编辑:code $wt(需要 VS Code),或者 notepad $wt。
3.4 外观:核心 JSON
在 settings.json 里找到 "profiles" → "defaults"。没有 defaults 就手动加一个,然后把下面这些键合并进去(已有同名键就改值,别重复写):
"profiles":
{
"defaults":
{
"font":
{
"face": "Maple Mono NF CN",
"size": 11,
"weight": "normal"
},
"colorScheme": "Catppuccin Mocha",
"opacity": 88,
"useAcrylic": true,
"padding": "10, 10, 8, 10",
"cursorShape": "bar",
"antialiasingMode": "grayscale",
"scrollbarState": "hidden",
"intenseTextStyle": "bright",
"copyOnSelect": true,
"multiLinePasteWarning": false
}
}
上面只是示意结构。实际编辑时:profiles 下如果已有 defaults,只把里面的键合并进去;list 数组保持原样不动。
逐条解释:
defaults 对所有 profile 生效(包括 cmd、WSL)。如果只想改 PowerShell 7,把同样的键写进 profiles.list 里对应那一项。
3.5 配色方案:Catppuccin Mocha
Windows Terminal 自带几套配色(Campbell、One Half Dark、Solarized…),但都不如社区配色耐看。这里给一套完整可用的 Catppuccin Mocha。
在 settings.json 根层级找到或新增 "schemes": [ ... ],把下面这整段加进数组:
{
"name": "Catppuccin Mocha",
"background": "#1E1E2E",
"foreground": "#CDD6F4",
"cursorColor": "#F5E0DC",
"selectionBackground": "#585B70",
"black": "#45475A",
"red": "#F38BA8",
"green": "#A6E3A1",
"yellow": "#F9E2AF",
"blue": "#89B4FA",
"purple": "#F5C2E7",
"cyan": "#94E2D5",
"white": "#BAC2DE",
"brightBlack": "#585B70",
"brightRed": "#F38BA8",
"brightGreen": "#A6E3A1",
"brightYellow": "#F9E2AF",
"brightBlue": "#89B4FA",
"brightPurple": "#F5C2E7",
"brightCyan": "#94E2D5",
"brightWhite": "#A6ADC8"
}
然后确认 profiles.defaults.colorScheme 的值和 "name" 一模一样(包括空格)。
Windows Terminal 1.24 及以上还有独立的 "themes" 数组,控制标签栏/标题栏颜色,和 "schemes" 不是一回事。两套都配好,视觉才统一。
如果保存后提示配色方案重名:说明你的 WT 版本已内置同名方案,直接删掉你粘贴的这段、在 UI 里选它即可;或者把两处 Catppuccin Mocha 都改成 Catppuccin Mocha Custom。
备选:Tokyo Night Storm(更偏蓝紫、对比更强)
{
"name": "Tokyo Night Storm",
"background": "#24283B",
"foreground": "#C0CAF5",
"cursorColor": "#C0CAF5",
"selectionBackground": "#364A82",
"black": "#1D202F",
"red": "#F7768E",
"green": "#9ECE6A",
"yellow": "#E0AF68",
"blue": "#7AA2F7",
"purple": "#BB9AF7",
"cyan": "#7DCFFF",
"white": "#A9B1D6",
"brightBlack": "#414868",
"brightRed": "#F7768E",
"brightGreen": "#9ECE6A",
"brightYellow": "#E0AF68",
"brightBlue": "#7AA2F7",
"brightPurple": "#BB9AF7",
"brightCyan": "#7DCFFF",
"brightWhite": "#C0CAF5"
}
3.6 背景图与毛玻璃(可选)
喜欢二次元壁纸/暗色纹理的,在 profiles.defaults 里加:
"backgroundImage": "C:\\Users\\<你的用户名>\\Pictures\\terminal-bg.jpg",
"backgroundImageOpacity": 0.22,
"backgroundImageStretchMode": "uniformToFill",
"backgroundImageAlignment": "center"
注意:
- 把 <你的用户名> 换成自己的 Windows 用户名,或直接改成任意图片路径。
- 路径里的反斜杠必须写成两个反斜杠(JSON 转义)。
- useAcrylic: true 和背景图同时开,部分驱动下背景图会被盖掉——二选一。
- 背景图透明度建议 0.15–0.3,太高会影响文字对比度。
3.7 启动与窗口
根层级(和 "profiles" 平级):
"launchMode": "maximized",
"startOnUserLogin": false,
"confirmCloseAllTabs": true
- launchMode:default / maximized / fullscreen / focus
- confirmCloseAllTabs:手滑关掉一堆标签页时的后悔药
3.8 快捷键小抄
分屏 + Quake 模式是效率提升最大的两个功能,建议练熟。
4. 第 2 步:Nerd Font 字体
4.1 为什么必须换字体
PowerShell 本身不需要特殊字体,但 Oh My Posh / Terminal-Icons / eza / Starship 会输出这些字符:
- Powerline 箭头:U+E0B0、U+E0B2
- Git 分支:U+E725
- 文件夹:U+F07B
- 各种语言 logo、电池、时钟图标(U+F179 等)
普通字体(微软雅黑、Consolas、Cascadia Code 原版)没有这些字形,就会显示成 □ 或 ?。
Nerd Font = 在等宽编程字体上 patch 了 3000+ 图标,一次解决。
4.2 字体怎么选
⚠️ 中文用户的关键坑:Cascadia Code / JetBrains Mono 不含中文。Windows Terminal 会逐字回退到微软雅黑,结果中文变成比例字体——宽度对不齐、行高跳动、表格错位。所以中文环境请优先选带 CJK 的 Maple Mono NF CN 或 Sarasa Term SC Nerd Font。
4.3 安装 Maple Mono NF CN(推荐,手动最稳)
- 打开 Release 页:github.com/subframe753…
- 在最新版本的 Assets 里下载 MapleMono-NF-CN.zip
- NF = Nerd Font(带图标)
- CN = 含中文
- 不要选 Variable 版本,静态版兼容性更好
- 解压,进入目录,全选所有 .ttf
- 右键 → 安装(或「为所有用户安装」,需要管理员)
- Windows 11 的右键菜单要先点 「显示更多选项」 才能看到「安装」
- 完全关闭并重开 Windows Terminal(字体缓存要刷新)
4.4 用 scoop 安装(一条命令,适合已装 scoop)
没有 scoop 先装:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
Invoke-RestMethod get.scoop.sh | Invoke-Expression
然后:
scoop bucket add nerd-fonts
scoop install nerd-fonts/Maple-Mono-NF-CN
更纱黑体(包名以 scoop search 的结果为准):
scoop search sarasa # 先看包名
scoop install nerd-fonts/Sarasa-Term-SC-Nerd
scoop 的好处:升级、卸载都一条命令,不用手动删字体。
4.5 验证字体装好了没
# 注册表里应该能看到字体的完整名字
@(
(Get-ItemProperty 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
) | Where-Object { $_ -match 'Maple|Nerd|Sarasa|Cascadia' } | Sort-Object -Unique
或者直接在终端里打印图标测试串:
"`u{e0b0} `u{e0b2} `u{f07b} `u{e725} `u{f1d3} `u{e70f}"
- 显示成一串彩色/单色图标 → 字体生效 ✅
- 显示成 □ □ □ 或 ? → 字体没生效或选错名字 ❌
最后在 Windows Terminal → 设置 → 外观 → 字体 → 字体面 的下拉列表里确认能搜到 Maple Mono NF CN。
4.6 字号与清晰度
配合 "antialiasingMode": "grayscale",细字重会更干净。
4.7 字体相关坑
5. 第 3 步:Oh My Posh 提示符
5.1 它是什么
Oh My Posh 只做一件事:根据当前目录、Git 状态、上条命令耗时、语言版本等信息,渲染一行漂亮的提示符。 它不接管你的 Shell,也不改命令行为——所以可以随时删掉,零风险。
同类竞品:Starship(Rust 写的,更快更简单,配置是 TOML)。后面第 10 章会讲怎么选。
5.2 安装
# 推荐:winget
winget install --id JanDeDobbeleer.OhMyPosh -e --source winget --accept-package-agreements --accept-source-agreements
# 或者 scoop
scoop install oh-my-posh
装完新开一个终端验证:
oh-my-posh --version
5.3 MSIX 安装有个坑:主题不在 POSH_THEMES_PATH 里
网上大多数教程会让你用 $env:POSH_THEMES_PATH 拼主题路径。在部分 MSIX 安装方式下,这个变量可能是空的,照抄会得到 CONFIG NOT FOUND。
不同安装方式的主题目录:
用下面这段自动定位(粘进终端执行一次即可):
function Get-OmpThemesDir {
# 旧版 / 便携版
if ($env:POSH_THEMES_PATH -and (Test-Path $env:POSH_THEMES_PATH)) {
return $env:POSH_THEMES_PATH
}
# MSIX 版
$pkg = $null
try { $pkg = Get-AppxPackage -Name ohmyposh.cli -ErrorAction Stop } catch { $pkg = $null }
if ($pkg) {
$p = Join-Path $pkg.InstallLocation 'themes'
if (Test-Path $p) { return $p }
}
# Get-AppxPackage 被策略拦住时,直接找安装目录
$pkgDir = $null
try {
$pkgDir = Get-ChildItem 'C:\Program Files\WindowsApps' -Directory -Filter 'ohmyposh.cli_*' -ErrorAction Stop |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
}
catch {
$pkgDir = $null
}
if ($pkgDir) {
$p = Join-Path $pkgDir.FullName 'themes'
if (Test-Path $p) { return $p }
}
# winget 便携包
$wingetPkg = Get-ChildItem (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages') -Directory -Filter 'JanDeDobbeleer.OhMyPosh*' -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($wingetPkg) {
$p = Join-Path $wingetPkg.FullName 'themes'
if (Test-Path $p) { return $p }
}
# scoop
$scoop = Join-Path $HOME 'scoop\apps\oh-my-posh\current\themes'
if (Test-Path $scoop) { return $scoop }
return $null
}
$ompThemes = Get-OmpThemesDir
$ompThemes
Get-ChildItem $ompThemes -Filter *.omp.json |
ForEach-Object { $_.Name -replace '\.omp\.json$', '' }
最后一行会列出一百多个主题名(catppuccin_mocha、tokyonight_storm、atomic…)。
如果 Get-OmpThemesDir 返回空:在普通(非管理员也可以) PowerShell 里跑
Get-AppxPackage ohmyposh.cli | Select-Object InstallLocation,把输出路径手动拼上 \themes。
5.4 第一步:把全部主题复制到自己的目录
不要直接引用安装目录——MSIX 升级后路径里的版本号会变,下次启动就找不到主题了。把主题全部复制出来,保持原文件名:
$configDir = "$HOME\.config\oh-my-posh"
New-Item -ItemType Directory -Path $configDir -Force | Out-Null
Copy-Item "$ompThemes\*.omp.json" -Destination $configDir -Force
(Get-ChildItem $configDir -Filter *.omp.json).Count
这样每个主题都保留原名,后面可以按名字切换,不用反复覆盖同一个文件。升级 Oh My Posh 也不会影响这份副本。
重新执行这一步会用安装目录里的版本覆盖同名主题;如果你已经改过某个主题,先备份,或者只复制需要的文件。
只想留几个主题也可以,把需要的 .omp.json 复制进去即可;下面按“全部复制”的方式讲。
5.5 初始化
先写入当前主题名:
Set-Content "$HOME\.config\oh-my-posh\active-theme.txt" 'catppuccin_mocha' -Encoding utf8
然后在 $PROFILE 里写:
$ompThemeDir = "$HOME\.config\oh-my-posh"
$ompThemeState = Join-Path $ompThemeDir 'active-theme.txt'
$ompThemeName = if (Test-Path $ompThemeState) {
(Get-Content $ompThemeState -Raw).Trim()
}
else {
'catppuccin_mocha'
}
$ompTheme = Join-Path $ompThemeDir "$ompThemeName.omp.json"
if (-not (Test-Path $ompTheme)) {
$ompTheme = Join-Path $ompThemeDir 'catppuccin_mocha.omp.json'
}
if ((Get-Command oh-my-posh -ErrorAction SilentlyContinue) -and (Test-Path $ompTheme)) {
oh-my-posh init pwsh --config $ompTheme | Invoke-Expression
}
保存后执行 . $PROFILE,提示符立刻变样。以后每次开新标签页,profile 都会读取 active-theme.txt,自动加载当前主题。
还没复制主题、只想先看默认效果的话:
oh-my-posh init pwsh | Invoke-Expression
如果报 oh-my-posh 不是内部或外部命令:PATH 没刷新
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Windows 11 Complete guide for terminal beautification
Applicable environment: Windows 11 22H2 and above, Windows Telminal 1.20+, PowerShell 7.2+ UI Theme: Need Windows Telminal 1.24 and above (see section 3.5) Target: Modern terminals from "white black, full-screen blocks" to "Farglass, Nerd icon, Git state, smart completion" ♪ Read chapter 2 "10 Minutes Speed" ♪ ♪ And try to figure out from chapter 0 ♪ Read
Impact Chart
It's in the front.
This is a Windows 11 terminal beautification program that starts from scratch, covering Windows Terminal, Nerd Font, Oh My Push hint, PSRheadLine completion, commonly used command line tools, and a set of direct-use profiles.
Examples are Catppuccin Mocha and Tokyo Night Storm, but none of the steps are tied to a specific theme: you can switch to an arbitrary colour and an OMP theme.
This is an example of the newer Windows Telminal and Oh My Push versions; compatibility ranges are indicated when there are differences in versions.
- There's no need to reload the system. All configurations are in the user directory.
- Each step can be rolled back alone, with an offloading and restoration section at the end.
- Command default executed in PowerShell 7, not Windows PowerShell 5.1
Contents
Let's figure out what you're beautifying.
A lot of people came up with a bunch of configurations, and they didn't know which level went wrong. There are only four layers of terminal beautification:
┌─────────────────────────────────────────────────────┐
│Windows Terminal (terminal host)│
Responsible: window, label, font rendering, colour colour, transparency, background chart
│ ┌───────────────────────────────────────────────┐ │
│ │ PowerShell 7(Shell) │ │
│ Responsible for: execution of orders, history, completion, highlighting of grammar, │
│ │ ┌─────────────────────────────────────────┐ │ │
Oh, my Posh.
In charge: Path, Git branch, time-consuming, version number...
│ │ └─────────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────┘ │
│ Font (Nerd Font): Provide arrows, file/language icons and equal width alignment │
└─────────────────────────────────────────────────────┘
Correct order: Terminal font poignant hint poignant completion poignant tool chain. The font is wrong, and all the icons in the back turn into squares -- the most common turning point for beginner.
1. Environmental self-examination
One minute to confirm the status. In PowerShell 7 (not Windows PowerShell 5.1):
#1. PowerShell version should read 7.x
$PSVersionTable.PSVersion
# 2. Windows Terminal exists
(Get-Command wt.exe).Source
# 3. Profile path for PowerShell 7 (none is normal)
$PROFILE
Test-Path $PROFILE
# 4. Implementation strategy, RemoteSigned
Get-ExecutionPolicy -List
#5. Is Nerd Font loaded
@(
(Get-ItemProperty 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
) | Where-Object { $_ -match 'Nerd|NF|Maple|Cascadia|Sarasa|Meslo' } | Sort-Object -Unique
How to judge your environment:
As long as PowerShell 7 and Windows Telminal are in position, other components can be put on side by side. This does not require cleaning old configurations first; profile and settings.json are pure text, changed to recover.
Two PowerShells.
- Windows PowerShell 5.1: System Autoband, protocol at Documents\WindowsPowerShell
- PowerShell 7: You put it, profile in Documents \PowerShell.
All configurations in this document are written in the 7 profile; it is normal to not be valid in 5.1.
2.10 Minute Speed (Lacked version)
I'm just trying to make it look good fast.
# 1 Load Oh My Posh
winget install --id JanDeDobbeleer.OhMyPosh -e --source winget --accept-package-agreements --accept-source-agreements
#2 Load fonts (interactive list, orientation keys, CascadiaCode back; Chinese users see Chapter 4)
oh-my-posh font install
#3 Copy all themes, write to the current theme, create a profile
$ompThemes = if ($env:POSH_THEMES_PATH) { $env:POSH_THEMES_PATH } else { (Get-AppxPackage ohmyposh.cli).InstallLocation + '\themes' }
New-Item -ItemType Directory "$HOME\.config\oh-my-posh" -Force | Out-Null
Copy-Item "$ompThemes\*.omp.json" -Destination "$HOME\.config\oh-my-posh" -Force
Set-Content "$HOME\.config\oh-my-posh\active-theme.txt" 'catppuccin_mocha' -Encoding utf8
New-Item -ItemType File -Path $PROFILE -Force
Noteped $PROFILE # Paste the template for chapter 8, save
If the Get-AppxPackage newspaper "No access", replace it with the Get-OmpThemesDir function in Section 5.3.
4 Opens Windows Terminal →Ctrl+, Appearance Queue Font Selection Cascadia Code NF (based on the name shown in the box below font, Chinese user 's Maple Mono NFCN ') with the 11 symbol. If you want to use Catppuccin, add JSON to section 3.5 to the scheme; choose One Half Dark first.
5 Turn off all terminal tabs and reopen. You can see the hints with icons and Git information.
In order to be more refined (Faceglass, Catppuccin Colour, Smart Completion, ll/z/fzf), continue reading down.
Step 1: Windows Terminal Configuration
3.1 Set Windows Terminal as default terminal
If not set, double click.ps1 and start from "Run" cmd will still pop up an old conhost window.
Method I (recommended): Windows Sets the Query System Query Developer Options Found Terminal Query Default Terminal Application Selection Windows Terminal.
Method 2: Windows Tell+, → Start → Default Terminal Application → Windows Terminal.
3.2 Default Open PowerShell 7
Ctrl+, → Starts the default configuration file → Select PowerShell (the icon is black >, not Windows PowerShell).
Set the startup as "maximizing" or "default" as you get used to.
3.3 Found and backed up
All the look of Windows Telminal ended up in settings.json. All the GUI can do is change the subsets. Transparent fur glass, background maps, scroll bars, anti-sawing.
Ctrl+, click the bottom left corner to open the JSON file. Documents usually appear at:
# Store Edition (majority)
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
# NonStore (winget/ scoop/ portable)
%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json
Backup (recommended, broken to roll back in seconds):
$wt = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
if (Test-Path $wt) {
Copy-Item $wt "$wt.bak" -Force
Backup to $wt.bak
} else {
"No Store version configuration found, check %LOCALAPDATA%
}
💡 You can also edit directly: code $wt (needs VS code), or notepad $wt.
3.4 Appearance: Core JSON
Finds "profiles" in settings.json. Without defaults, add one manually and then merge the following keys into it (revalued with the same name already in place, do not repeat):
"profiles":
{
"defaults":
{
"font":
{
"face": "Maple Mono NF CN",
"size": 11,
"weight": "normal"
},
"colorScheme": "Catppuccin Mocha",
"opacity": 88,
"useAcrylic": true,
"padding": "10, 10, 8, 10",
"cursorShape": "bar",
"antialiasingMode": "grayscale",
"scrollbarState": "hidden",
"intenseTextStyle": "bright",
"copyOnSelect": true,
"multiLinePasteWarning": false
}
}
It's just an indicative structure. When you edit it, the key will only be merged if there are defaults; list arrays will remain as they are.
Article by article:
Data is valid for all cases (including cmd, WSL). If you just want to change PowerShell 7, write the same key into the files.list.
3.5 Colour scheme: Catppuccin Mocha
Windows Telminal brought some colours (Campbell, One Half Dark, Solarized...), but not as good as the community. Here's a complete set of Catppuccin Mochas available.
Find or add "schemes" at the root level of settings.json: [...] Add the following whole paragraph to the array:
{
"name": "Catppuccin Mocha",
"background": "#1E1E2E",
"foreground": "#CDD6F4",
"cursorColor": "#F5E0DC",
"selectionBackground": "#585B70",
"black": "#45475A",
"red": "#F38BA8",
"green": "#A6E3A1",
"yellow": "#F9E2AF",
"blue": "#89B4FA",
"purple": "#F5C2E7",
"cyan": "#94E2D5",
"white": "#BAC2DE",
"brightBlack": "#585B70",
"brightRed": "#F38BA8",
"brightGreen": "#A6E3A1",
"brightYellow": "#F9E2AF",
"brightBlue": "#89B4FA",
"brightPurple": "#F5C2E7",
"brightCyan": "#94E2D5",
"brightWhite": "#A6ADC8"
}
Then confirm that the value of the colorScheme is exactly the same as "name" (including spaces).
Windows Telminal 1.24 and above have separate "themes" arrays, control label/titlebar colours, and "schemes" are not the same. Both pairs fit, so the vision is uniform.
If save-to-show color scheme renames: state that your WT version has the same name in it, delete the one you pasted, select it in UI; or change both of Catppuccin Mocha to Catppuccin Mocha Custom.
Alternative: Tokyo Night Storm
{
"name": "Tokyo Night Storm",
"background": "#24283B",
"foreground": "#C0CAF5",
"cursorColor": "#C0CAF5",
"selectionBackground": "#364A82",
"black": "#1D202F",
"red": "#F7768E",
"green": "#9ECE6A",
"yellow": "#E0AF68",
"blue": "#7AA2F7",
"purple": "#BB9AF7",
"cyan": "#7DCFFF",
"white": "#A9B1D6",
"brightBlack": "#414868",
"brightRed": "#F7768E",
"brightGreen": "#9ECE6A",
"brightYellow": "#E0AF68",
"brightBlue": "#7AA2F7",
"brightPurple": "#BB9AF7",
"brightCyan": "#7DCFFF",
"brightWhite": "#C0CAF5"
}
3.6 Background maps and gross glass (optional)
You like binary wallpaper/dark color texture, at profils.defaults Riga:
"background Image":
"backgroundImageOpacity": 0.22,
"backgroundImageStretchMode": "uniformToFill",
"backgroundImageAlignment": "center"
Note:
- Change your username to your Windows username, or directly to any picture path.
- The back slash in the path must be written in two (JSON transliteration).
-useAcrylic: True and background maps are opened at the same time and the partially driven background maps are covered — two or one.
- A proposal for transparency in the background diagram is 0.15-0.3, too high to affect text contrast.
3.7 Start and Window
Root level (and "profiles" lateral level):
"launchMode": "maximized",
"startOnUserLogin": false,
"confirmCloseAllTabs": true
- launchMode:default / maximized / fullscreen / focus
- confirmCloseAllTabs: a bunch of tablets to regret when they slide off.
3.8 Short copy of shortcut keys
The break screen + Quake model is the two most efficient functions and is recommended to be refined.
Step 2: Nerd Font Font
4.1 Why change fonts?
PowerShell does not itself need special fonts, but Oh My Push / Terminal-Icons / eza / Starship will output these characters:
- Powerline Arrow: U+E0B0, U+E0B2
- Git branch: U+E725
- Folder: U+F07B
- Language logo, batteries, clock icons (U+F179 etc.)
Normal fonts (", Consolas, Cascadia Code) are shown in □ or?
Nerd Font = a 3000+ icon on the equal width programming font, one-time solution.
4.2 What's the font?
⚠️ Critical pit for Chinese users: Cascadia Code / Jetbrains Mono does not contain Chinese. Windows Telminal goes word for word rollback to, and the result is Chinese into proportional fonts -- width mismatches, line high beats, table error. So please give preference to Maple Mono NFCN with CJK or Sarasa Term SC Nerd Font.
4.3 Installation of Maple Mono NFCN (recommended, manual most stable)
Release page: Github.com/subframe753...
- Download MapleMono-NF-CN.zip in the latest version of Assets
-NF = Nerd Font
-CN = Chinese
- Don't choose Variable. Still more compatible.
- Unpressure, enter the directory, select all.ttf
- Right button installation (or "installation for all users", needing administrator)
- Windows 11's right-key menu needs to start "Show More Options" before you can see "Setting"
- Shut down completely and reopen Windows Terminal.
4.4 Installation with scoop (a command suitable for installed scoop)
No scoop preload:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
Invoke-RestMethod get.scoop.sh | Invoke-Expression
Then:
scoop bucket add nerd-fonts
scoop install nerd-fonts/Maple-Mono-NF-CN
More sarcastically (the package name is based on the result of scoop search):
Look at the name of the bag first.
scoop install nerd-fonts/Sarasa-Term-SC-Nerd
scoop benefits: Upgrade, unmounting is all an order without manually deleting fonts.
4.5. Is the proof font in?
# The full name of the font should be on the register
@(
(Get-ItemProperty 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts').PSObject.Properties.Name
) | Where-Object { $_ -match 'Maple|Nerd|Sarasa|Cascadia' } | Sort-Object -Unique
Or print the icon test string directly in the terminal:
"`u{e0b0} `u{e0b2} `u{f07b} `u{e725} `u{f1d3} `u{e70f}"
- Show as a bunch of colour/single icons
- Show as □ or ? font is not working or wrong name
Finally, you can find Maple Mono NFCN in the drop-down list of Windows Telminal settings.
4.6 Character and clarity
Along with "antialiasing Mode": "grayscale", it'll be cleaner.
4.7 Font-related pits
Step 3: Oh My Push hint
5.1 WHAT IS IT?
Oh My Push only does one thing: render a beautiful line of hints based on the current directory, Git status, time-consuming last command, language versions, etc. It doesn't take over your Shell or change command line -- so it can be deleted at any time, zero risk.
Same competition: Starship. What's next in chapter 10?
5.2 Installation
# Recommendation: Winget
winget install --id JanDeDobbeleer.OhMyPosh -e --source winget --accept-package-agreements --accept-source-agreements
# Or scoop
scoop install oh-my-posh
Load a new terminal authentication:
oh-my-posh --version
5.3 MSIX installation has a pit: the subject is not in POSH THEES PATH
Most online tutorials will allow you to spell theme paths with $env:POSH THEMES PATH. This variable may be empty under the partial MSIX installation, and the copy will get CONFIG NOT FOUND.
Theme directory for different modes of installation:
Automatically locate with the following:
function Get-OmpThemesDir {
# Old / portable
if ($env:POSH_THEMES_PATH -and (Test-Path $env:POSH_THEMES_PATH)) {
return $env:POSH_THEMES_PATH
}
# MSIX Version
$pkg = $null
try { $pkg = Get-AppxPackage -Name ohmyposh.cli -ErrorAction Stop } catch { $pkg = $null }
if ($pkg) {
$p = Join-Path $pkg.InstallLocation 'themes'
if (Test-Path $p) { return $p }
}
# Get-AppxPackage when strategy stops, look for installation directories
$pkgDir = $null
try {
$pkgDir = Get-ChildItem 'C:\Program Files\WindowsApps' -Directory -Filter 'ohmyposh.cli_*' -ErrorAction Stop |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
}
catch {
$pkgDir = $null
}
if ($pkgDir) {
$p = Join-Path $pkgDir.FullName 'themes'
if (Test-Path $p) { return $p }
}
# Winget handbag
$wingetPkg = Get-ChildItem (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages') -Directory -Filter 'JanDeDobbeleer.OhMyPosh*' -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($wingetPkg) {
$p = Join-Path $wingetPkg.FullName 'themes'
if (Test-Path $p) { return $p }
}
# scoop
$scoop = Join-Path $HOME 'scoop\apps\oh-my-posh\current\themes'
if (Test-Path $scoop) { return $scoop }
return $null
}
$ompThemes = Get-OmpThemesDir
$ompThemes
Get-ChildItem $ompThemes -Filter *.omp.json |
ForEach-Object { $_.Name -replace '\.omp\.json$', '' }
The last line lists more than 100 theme names (catppuccin mocha, tokyonight storm, tomic...).
If Get-OmpThemesDir returns empty: running in plain (non-administrator can also) PowerShell
Get-AppxPackage ohmmyposh.cli |Select-ObjectInstallLocation, manually spell \themes.
5.4 Step 1: Copy all themes to their own directory
Do not refer directly to the installation directory - the version number in the path after the MSIX upgrade will change and the theme will not be found next time you start. Copy all themes and keep the original file name:
$configDir = "$HOME\.config\oh-my-posh"
New-Item -ItemType Directory -Path $configDir -Force | Out-Null
Copy-Item "$ompThemes\*.omp.json" -Destination $configDir -Force
(Get-ChildItem $configDir -Filter *.omp.json).Count
Each theme would be kept in its original name, followed by a name-to-name switch, without having to cover the same document repeatedly. Upgrading Oh My Push will not affect this copy.
Re-executing this step will overwhelm the same name theme with the version in the installation directory; if you have changed a theme, back up first, or only copy the required document.
Only a few themes can be left, but just copy the.omp.json that is needed; here we go.
5.5 Initialization
Write the current theme name first:
Set-Content "$HOME\.config\oh-my-posh\active-theme.txt" 'catppuccin_mocha' -Encoding utf8
And write in $PROFILE:
$ompThemeDir = "$HOME\.config\oh-my-posh"
$ompThemeState = Join-Path $ompThemeDir 'active-theme.txt'
$ompThemeName = if (Test-Path $ompThemeState) {
(Get-Content $ompThemeState -Raw).Trim()
}
else {
'catppuccin_mocha'
}
$ompTheme = Join-Path $ompThemeDir "$ompThemeName.omp.json"
if (-not (Test-Path $ompTheme)) {
$ompTheme = Join-Path $ompThemeDir 'catppuccin_mocha.omp.json'
}
if ((Get-Command oh-my-posh -ErrorAction SilentlyContinue) -and (Test-Path $ompTheme)) {
oh-my-posh init pwsh --config $ompTheme | Invoke-Expression
}
After saving executes. $PROFILE, the hint changes immediately. Every time you open a new tab page, the current theme is automatically loaded with an active-theme.txt.
If you don't copy the theme, you just want to see the default effect:
oh-my-posh init pwsh | Invoke-Expression
If report oh-my-posh is not an internal or external order: PATH is not updated
Auto-fetched and translated by AI Atlas. All rights belong to the original author.