admin管理员组文章数量:1580707
一、PowerShell美化
1.安装新款 PowerShell
点击下载新款 PowerShell
用管理员模式打开刚装好的新版 powershell,依次安装以下软件
# 更改执行策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# 查看当前执行策略
# Get-ExecutionPolicy -Scope CurrentUser
2.安装 PSReadLine
install-module -Name PSReadLine -AllowPrerelease -Force
PSReadLine 是一个由微软发布的用于 PowerShell 的行读取实现,提供了以下功能:
- 语法着色
- 简单语法错误通知
- 良好的多行体验
- 可自定义的键绑定
- Cmd 和 Emacs 模式
- 许多配置选项
- Bash 样式的补全
- Bash/zsh 样式的交互式历史记录搜索
- Emacs yank/kill ring
- 基于 PowerShell Token 的单词移动和删除
- 撤销 / 重做
- 自动保存历史记录,包括在实时会话中共享历史记录
- 菜单补全、Intellisense
3.安装 oh-my-posh
Install-Module oh-my-posh -Scope CurrentUser
# 卸载
# Uninstall-Module oh-my-posh -AllVersions
oh-my-posh 为 PowerShell 提供了很多自定义主题和配色
4.安装posh-git
install-module posh-git -Scope CurrentUser
# 卸载
# Uninstall-Module posh-git -AllVersions
posh-git 为 PowerShell 提供了 git 状态显示和命令补全等
5.执行以下命令编辑 PowerShell 配置文件
notepad.exe $Profile
#这个文件会在 PowerShell 启动的时候自动执行,因此我们在这个文件中加载我们所需的模块。
#导入需要的模块
Import-Module posh-git
Import-Module oh-my-posh
#设置主题
Set-Theme Honukai
#新版的 oh-my-posh 将 Set-Theme 指令修改为了 Set-PoshPrompt 命令
#可选主题如下
#Agnoster,Avit,Darkblood,Fish,Honukai,Paradox,PowerLine,robbyrussell,Sorin,tehrob
6.安装需要的字体(否则会出现乱码)
(1)下载需要的字体
字体1下载
字体2下载
(2)安装字体
将下载好的字体(一般为 *.ttf 文件复制到 C:\Windows\Fonts 文件夹下)
二、美化 Windows Terminal
1.设置默认打开 新版 powershell
Windows Terminal 默认为旧版本的 powershell,我们需要把新版本作为默认打开应用
2.设置 windows Terminal 的主题
Windows Terminal 主题网站
3设置 windows Terminal 的字体
将 windows terminal 的字体设置为你新安装的字体
三、参考博文
博文一
博文二
【powershell】oh-my-posh安装和配置避坑指南 - 王大桃zzZ - 博客园
oh-my-posh安装过程问题及注意事项_Every DAV inci的博客-CSDN博客_安装oh-my-posh
版权声明:本文标题:Windows Terminal 美化教程 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1727875605a1135138.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论