关于powershell:Powershell-Windows-Terminal最简单的美化

6次阅读

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

网上一大堆丑化教程,啰里啰唆,还讲不清,并且一堆谬误

第一步装置模块

powershell 管理员身份运行,并执行以下。

## 容许执行脚本
set-executionpolicy remotesigned
Install-module PSReadline
Install-Module posh-git
Install-Module oh-my-posh
Install-Module DirColors

第二步 导入模块

Import-Module PSReadline
Import-Module DirColors
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme powerLine

但此时,只利用到以后,下次关上还是老样子,这样,咱们就给加个配置文件

第三步 配置

首先记事本关上
notepad $profile
接着输出如下内容并保留

Import-Module PSReadline
Import-Module DirColors
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme powerLine

第四步 装置个难看的字体

装置字体是必须的,否则可能呈现乱码。这里既然用的 Theme powerLine,那咱们就下 powerLine 字体
powerline/fonts: Patched fonts for Powerline users. (github.com)
下载当前,找到 DejaVu Sans Mono for Powerline.ttf 装置
并在 windows terminal 设置里设置好该字体

第五步 给 windows terminal 选个适合的配色

在 Terminal 的配置 json 文件中插入
"colorScheme": "One Half Dark",

间接窗口抉择也能够

我的成品,是不是难看多了!

正文完
 0