美化Window Terminal PowerShell

1、下载字体

Nerd Fonts - Iconic font aggregator, glyphs/icons collection, & fonts patcher

注:后面设置字体font: CaskaydiaMono Nerd Font

2、安装字体

3、安装 oh-my-posh

oh-my-posh文档地址:https://ohmyposh.dev/docs/windows

在终端中安装oh-my-posh:

winget install JanDeDobbeleer.OhMyPosh


升级:

winget upgrade JanDeDobbeleer.OhMyPosh

4、主题配置

将下载的主题放入 ~\AppData\Local\Programs\oh-my-posh\themes\目录即可。

oh-my-posh/themes at main · JanDeDobbeleer/oh-my-posh · GitHub

5、设置字体

 

6、设置主题

 1.更改PowerShell安全策略
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
2.打开配置文件

notepad $PROFILE

如果配置文件不存在,会提示创建新文件,或者以PowerShell命令创建:

New-Item -Path $PROFILE -Type File -Force

3.写入命令

oh-my-posh init pwsh | Invoke-Expression

4.重新加载配置

. $PROFILE

5.查看可用主题

Get-PoshThemes

6.打开末尾图片路径,将完整主题名配置上。

notepad $PROFILE
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/主题名" | Invoke-Expression
. $PROFILE

7.其他

 增强:PSReadLine、oh-my-posh、posh-git,包括语法高亮、错误提示等。

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值