更换字体
为了能够正确显示图标和特殊字符,推荐从 Nerd Fonts 挑选并安装一款字体:
随后进入 Windows Terminal 的设置页面更换默认字体,这里以 JetBrainsMono Nerd Font
为例:

更换配色
除了自带的几种配色方案之外,Windows Terminal Themes 还有上百种配色方案可供选择:
挑选一种配色方案并点击 Get theme,下面以 GitHub Dark
为例:

打开 Windows Terminal 配置文件,在 defaults 中指定默认配色并将配色方案粘贴到 schemes 数组:
1 | { |
定制提示符 (PowerShell)
什么是提示符?
提示符是一串用来显示命令行当前所处位置及状态的字符,PowerShell 的默认提示符是 PS C:\>
。
安装 Oh My Posh,这是一款支持通过 JSON 配置文件定制提示符的工具:
1 | Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1')) |
在 Oh My Posh Themes 挑选一个主题,下面以 jandedobbeleer
为例:
使用记事本打开或创建 PowerShell 配置文件:
1 | if ($PROFILE) { |
复制如下内容,用于在 PowerShell 启动时初始化 Oh My Posh 并应用主题文件:
1 | oh-my-posh.exe init pwsh --config "$env:POSH_THEMES_PATH/jandedobbeleer.omp.json" | Invoke-Expression |
保存 PowerShell 配置文件,然后打开一个新的 Windows Terminal 标签页查看主题是否生效:

Oh My Posh 主题分享
最后,附上一款我自己制作的 Oh My Posh 主题:

配置文件如下所示:
1 | { |