文章目录
前言
我又闲来无事,开始折腾。之前在黑苹果上搞了Iterm2+Oh my zsh打造了挺好看的终端。这次想美化一下Windows的终端,以前一直在用fluent terminal ,现在微软自家出了Windows Terminal。踩了点坑,也参考了几个教程。先放个效果图:
一、安装Windows Terminal
直接去Microsoft Store搜索安装
二、安装Oh my Posh和字体库
1.安装oh-my-posh(类似oh-my-zsh)
如果尚未安装Git for Windows,请: 安装适用于 Windows 的 Git.
# 1. 安装 choco
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# 2. 安装ConEmu
choco install ConEmu
# 3. 安装 posh-git
Install-Module posh-git -Scope CurrentUser
这一步应该可以正常安装
# 4. 安装 oh-my-posh
Install-Module oh-my-posh -Scope CurrentUser
这里的oh-my-posh,在我的机器上因为网络问题一直是0%,所以就采用了另一种安装方法
- 下载oh-my-posh文件,这里我挂vpn下好了,放到了百度云
链接:oh-my-posh.
提取码:etqk - 将下载的文件放到powershell的module目录下
C:\Windows\System32\WindowsPowerShell\v1.0\Modules
- 获取PowerShell 可安装模块
Get-Module -ListAvailable
- 为当前用户安装oh-my-posh
Install-Module oh-my-posh -Scope CurrentUser
如果在安装过程中遇到类似于这样的提示:
不受信任的存储库你正在从不受信任的存储库安装模块。如果你信任该存储库,
请通过运行 Set-PSRepositorycmdlet 更改其 InstallationPolicy 值。
是否确实要从“PSGallery”安装模块?[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(