使用 oh-my-posh 美化 Windows Terminal 吧!

安装依赖?

先从此处下载 PowerShell 7

重新打开 Windows Terminal 输入:

我使用的是 JetBrainsMono

调整配置文件

打开 pwsh 配置文件

我安装了 VSCode CLI,未安装可以使用 notepad $PROFILE 打开
在文件首行添加

1
2
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\montys.omp.json | Invoke-Expression
Import-Module -Name Terminal-Icons

image
完成上方操作后

  1. 在 Windows Terminal 设置的左下角点击打开 JSON 文件,或者直接使用组合键 (Ctrl + Shift +,) 打开 setttings.json

  2. “defaults”: {} 字段中添加

    1
    2
    3
    4
    "font": 
    {
    "face": "JetBrainsMono Nerd Font Mono"
    }

    image

效果展示

overview