Windows Terminal美化
Windows Terminal是微软新发布的一款Terminal产品(以下称WT)。对比之前传统的cmd和Powershell来说,WT对定制的支持更好,同时又支持GPU对页面的渲染、emoji表情、多标签等的特点。其项目地址为:https://github.com/microsoft/terminal。 由于WT的可定制化非常之高,只需要很简单的步骤就可以调节各种界面元素以及操作习惯,所以把它打造成最适合自己的Windows终端程序是完全做得到的。 下面主要分为两个部分来美化WT: 安装oh-my-posh(类似于Linux上的oh-my-zsh) 安装scoop 首先在Powershell中输入以下代码来保证允许本地脚本的执行: 1 set-executionpolicy remotesigned -scope currentuser 然后就可以脚本安装scoop了: 1 iex (new-object net.webclient).downloadstring('https://get.scoop.sh') 更换Powerline字体 Powerline字体有很多种,这里使用了Fira Code,项目地址为https://github.com/tonsky/FiraCode,下载后安装在电脑上即可,其他字体可自行搜索。 安装在电脑上之后,只需要在WT的配置文件profiles.json中修改显示字体就可以了,这个下面会讲到。 安装choco 1 Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 安装ConEmu 1 choco install ConEmu 安装 posh-git、oh-my-posh 和 Get-ChildItemColor 前两个是oh-my-posh的必备组件,最后一个是美化ls命令的显示效果的插件,可以选装。 1 2 3 Install-Module posh-git -Scope CurrentUser Install-Module oh-my-posh -Scope CurrentUser Install-Module Get-ChildItemColor -Scope CurrentUser 设置 Powershell 的 profile 1 if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force } 打开$PROFILE文件并粘贴以下内容...