关于powershell:win11中的终端美化

9次阅读

共计 984 个字符,预计需要花费 3 分钟才能阅读完成。

win11(windows terminal)+powershell 7 + oh-my-posh 丑化终端

  1. 卸载老版的 windows terminal
  2. 去微软装置最新的 windows terminal
  3. 配置 windows terminal JSON 文件
{
    ...
    "profiles": {
      // todo 用上面这个 defaults 笼罩原文件中的 defaults 这一项
    "defaults": {
      // 这个背景图片本人上电脑找张喜爱的图而后复制门路过去, 留神斜杠反过来
      "backgroundImage": "C:/Users/Administrator/Pictures/1.jpg",
      "backgroundImageOpacity": 0.1,
      "font": {
         // 这是应用的字体, 可自定义, 我喜爱用 JetBrainsMono Nerd Font Mono
        "face": "JetBrainsMono Nerd Font Mono"
      },
      "opacity": 95,
      "useAcrylic": true
    },
}
  1. 装置字体
    https://wsxl.lanzouw.com/iOoE…

    明码:1dk7

  2. 在微软装置 winget
  3. 用 winget 装置 oh-my-posh
winget install JanDeDobbeleer.OhMyPosh
  1. 配置
 关上配置文件:code $PROFILE

其中 montys.omp.json 是主题文件

  • 将上面这一段复制到文件中
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\montys.omp.json | Invoke-Expression
cls
  • 更多主题抉择
C:\Users\Administrator\AppData\Local\Programs\oh-my-posh\themes
  • 我的主题
material.omp.json
amro.omp.json// 正在用
emodipt.omp.json
neko.omp.json : 好玩, 猫头像 

其它报错

因为在此零碎上禁止运行脚本。无关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的

  • 解决办法
get-executionpolicy
# 设置执行策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
正文完
 0