教你如何拥有好看的CMD界面 如何美化Windows Terminal

wt

安装Windows Terminal

在Mircosoft Store可以安装 只有6M。
在这里插入图片描述

PowerShell 必备条件

使用 PowerShell,安装 Posh-Git 和 Oh-My-Posh:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

提示
如果尚未安装 NuGet,可能需要安装它。 如果是这种情况,PowerShell 命令行会询问是否要安装 NuGet。 选择 [Y]“是”。 你可能还需要批准从不受信任的存储库 PSGallery 中安装模块。 选择 [Y]“是”。

Posh-Git 将 Git 状态信息添加到提示,并为 Git 命令、参数、远程和分支名称添加 tab 自动补全。 Oh-My-Posh 为 PowerShell 提示符提供主题功能。

之后使用 notepad $PROFILE 或所选的文本编辑器打开 PowerShell 配置文件, 它可能会提示你要新建一个文件 点 就行 在新建的文件里输入

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

这样,在每次PoweShell打开的时候都能启用Paradox主题

配置setting.json

在这里插入图片描述

由于WT是开源的 所以我们可以对其进行配置。只需修改一些json~
下面的json是我的配置方案

"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",

"confirmCloseAllTabs": false, // 隐藏关闭所有选项卡弹出窗口
"launchMode": "default", // 这将定义终端在启动时将采用最大化、全屏还是窗口形式 "default"、"maximized"、"fullscreen"
"initialPosition": "250,40", // 窗口打开的默认位置
"initialCols": 100, // 初始化窗口默认列数
"initialRows": 28, // 初始化窗口默认行数
"profiles":
{
      "defaults":
      {
          // Put settings here that you want to apply to all profiles.
          "fontFace": "Fira Code", // oh-my-posh 主题原因,使用其他的字体可能会出现乱码
          "backgroundImage": "C:\\Users\\94393\\Pictures\\Saved Pictures\\20200715115029.jpg", // 背景图片地址
          "backgroundImageOpacity": 0.5, // 透明度
          "colorScheme" : "Slate", // 颜色方案
          "acrylicOpacity": 0.7,
          "useAcrylic":true
      },
      "list":
      [
          {
              // Make changes here to the cmd.exe profile.
              "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
              "name": "我爱你啊",
              "commandline": "cmd.exe",
              "icon": "C:\\Users\\94393\\Pictures\\Saved Pictures\\zzj.png",
              "colorTheme": "Slate",
              "startingDirectory": null, // 在文件夹地址栏输入wt即刻打开
              "hidden": false
          },
          {
              // Make changes here to the powershell.exe profile.
              "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
              "name": "Windows PowerShell",
              "commandline": "powershell.exe",
              "hidden": false
          },
          {
              "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
              "hidden": false,
              "name": "Azure Cloud Shell",
              "source": "Windows.Terminal.Azure"
          }
      ]
  }
 "schemes": [
        {
            "name": "Slate",
            "black": "#222222",
            "red": "#e2a8bf",
            "green": "#81d778",
            "yellow": "#c4c9c0",
            "blue": "#264b49",
            "purple": "#a481d3",
            "cyan": "#15ab9c",
            "white": "#02c5e0",
            "brightBlack": "#ffffff",
            "brightRed": "#ffcdd9",
            "brightGreen": "#beffa8",
            "brightYellow": "#d0ccca",
            "brightBlue": "#7ab0d2",
            "brightPurple": "#c5a7d9",
            "brightCyan": "#8cdfe0",
            "brightWhite": "#e0e0e0",
            "background": "#222222",
            "foreground": "#35b1d2"
      	}
    ]

参数解读

  • fontFace : 字体 可以去下载fairCode 下载地址 下载之后解压并安装 不会的 百度一下
  • defaultProfile :默认打开的profile 如果你要默认打开cmd ,需要找到list -> cmd -> guid 复制到defaultProfile的值里
  • backgroundImage: 窗口的背景图片,要使用绝对路径,并且下划线要转义
  • colorScheme : 颜色方案 选取地址 进去之后选择一个喜欢的主题 然后点击 get theme 来到setting.json文件 找到schemes数组,复制就ok!

总结

基础配置就这些啦,如果你还想配置的更好,你可以去看官方文档

  • 7
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值