Windows Terminal 美化

Windows Terminal 美化

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

安装依赖?

先从此处下载 PowerShell 7

$
winget install JanDeDobbeleer.OhMyPosh gerardog.gsudo
$
Install-Module -Name Terminal-Icons -Repository PSGallery

重新打开 Windows Terminal 输入:

$
sudo oh-my-posh font install

我使用的是 JetBrainsMono

调整配置文件

打开 pwsh 配置文件

$
code $PROFILE

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

ps1
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 +:key{text=","}) 打开 setttings.json
  2. defaults 字段中添加字体配置。
json
{
  "font": {
    "face": "JetBrainsMono Nerd Font Mono"
  }
}

image

效果展示

overview

让PVE显示更多系统状态
Windows 字体美化