天天看點

美化Windows系統的終端

本文介紹如何給Windows系統的終端進行打扮,最下面會有效果圖

一、安裝FluentTerminal

1、下載下傳

前往

GitHub

找到下面的檔案下載下傳

美化Windows系統的終端

2、安裝

下載下傳後解壓,進入解壓後的目錄,找到

Install.ps1

檔案,右擊使用

PowerShell

運作,彈出

PowerShell

後,按照提示,就可以成功安裝了。

二、安裝oh my posh

1、設定可執行任意腳本

以管理者身份打開PowerShell執行以下指令,碰到詢問你是否幹嘛幹嘛的,直接輸入

Y

确認

Set-ExecutionPolicy Bypass           

2、安裝posh-git

Install-Module posh-git -Scope CurrentUser           

3、安裝 oh my posh

碰到詢問你是否幹嘛幹嘛的,直接輸入

Y

Install-Module oh-my-posh -Scope CurrentUser           

4、啟用

Import-Module oh-my-posh           

三、美化

1、安裝Scoop

環境要求:

1、Windows 版本不低于 Windows 7

2、Windows 中的 PowerShell 版本不低于 PowerShell 3

3、你能 正常、快速 的通路 GitHub 并下載下傳上面的資源

4、你的 Windows 使用者名為英文(Windows 使用者環境變量中路徑值不支援中文字元)

執行指令

#保證允許本地腳本的執行
set-executionpolicy remotesigned -scope currentuser
# 安裝
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')           

2、安裝字型

# 搜尋 nerd fonts,這裡選擇是的FantasqueSansMono這個字型
scoop search FantasqueSansMono-NF
# 添加 nerd fonts 源
scoop bucket add 'nerd-fonts'
# 安裝 nerd fonts
scoop install FantasqueSansMono-NF           

3、配置

以下是我舉例的配置,如果需要更換樣式,将

Set-Theme

後面的配置改成自己想要的即可,在指令行通過輸入

Set-Theme

以後空格以下然後按

tab

鍵選擇你想要的,這都是

oh-my-posh

自帶的,選擇好了之後将那個名字替換掉下面指令的即可

# 1、設定 Powershell 的 profile
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
# 2、打開該配置檔案
notepad $PROFILE
# 3、複制以下内容到配置檔案儲存
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Agnoster           

通過上面的操作後,關閉所有已經打開的指令行,重新啟動指令行,就可以看到效果啦,進入一個git項目,效果圖如下

美化Windows系統的終端

文章到此結束啦,有啥疑問可以在評論區留言哦

繼續閱讀