作者:小叶2502854061 | 来源:互联网 | 2023-10-11 15:48
windows 终端美化
Windows Terminal
是 windows 一个终端工具,我们可以美化它来让自己赏心悦目。
通常电脑系统自带,如果没有的话可以通过 Microsoft Store
(微软商店),搜索 Windows Terminal
进行安装。
如果遇到了一些问题,还可以通过 Github
,搜索 Windows Terminal
进行安装。
美化
当我们能成功打开应用之后,就可以开始进行美化工作啦
首先安装 posh-git
,他可以对 git
命令进行一些支持
然后安装 oh-my-posh
,它提供了很多主题,让我们来尽心美化
Install-Module posh-git
winget install oh-my-posh
oh-my-posh get shell
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\M365Princess.omp.json" | Invoke-Expression
主题颜色网站1
主题颜色网站2
我们还可以进入 M365Princess.omp.json
,去修改主题样式,做成自己喜欢的样子
{"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json","blocks": [{"alignment": "left","segments": [{"type": "text","style": "diamond","leading_diamond": "\ue0b6","foreground": "#ffffff","background": "#cc3802","template": "{{ if .Env.PNPPSHOST }} \uf8c5 {{ .Env.PNPPSHOST }} {{ end }}"},{"type": "text","style": "powerline","foreground": "#ffffff","background": "#047e84","powerline_symbol": "\ue0b0","template": "{{ if .Env.PNPPSSITE }} \uf672 {{ .Env.PNPPSSITE }}{{ end }}"},{"type": "text","style": "diamond","trailing_diamond": "\ue0b4","foreground": "#ffffff","background": "#047e84","template": "{{ if .Env.PNPPSSITE }}\u00A0{{ end }}"}],"type": "rprompt"},{"alignment": "left","segments": [{"background": "#DA627D","foreground": "#ffffff","powerline_symbol": "\ue0b0","properties": {"style": "full"},"style": "powerline","template": " {{ .Path }} ","type": "path"},{"background": "#FCA17D","foreground": "#ffffff","powerline_symbol": "\ue0b0","properties": {"branch_icon": "","fetch_stash_count": true,"fetch_status": false,"fetch_upstream_icon": true},"style": "powerline","template": " \uf408 ({{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }}) ","type": "git"},{"background": "#86BBD8","foreground": "#ffffff","powerline_symbol": "\ue0b0","style": "powerline","template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ","type": "node"},{"background": "#33658A","foreground": "#ffffff","properties": {"time_format": "15:04"},"style": "diamond","template": " \u2665 {{ .CurrentDate | date .Format }} ","trailing_diamond": "\ue0b0","type": "time"}],"type": "prompt"}],"final_space": true,"version": 2
}
一些我认为好看的颜色
background-color: aquamarine;
background-color: #cc3802;
background-color: #9A348E;
background-color: #DA627D;
background-color: #FCA17D;
background-color: #86BBD8;
background-color: #33658A;
Tip:
windows powershell
和 powershell
不一样powershell
更强大且支持跨端- 日常的使用
windows powershell
和 powershell
区别不大
xieliuning 2022-05-01